Ignore:
Timestamp:
Feb 17, 2021, 10:09:04 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
1294d7f, f4f3f59
Parents:
1717b12 (diff), 830299f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/startup.cfa

    r1717b12 ra76da32  
    8080static void ?{}(processorCtx_t & this) {}
    8181static void ?{}(processorCtx_t & this, processor * proc, current_stack_info_t * info);
     82static void ?{}(__bin_sem_t & this);
     83static void ^?{}(__bin_sem_t & this);
    8284
    8385#if defined(__CFA_WITH_VERIFY__)
     
    736738}
    737739
     740extern "C" {
     741        char * strerror(int);
     742}
     743#define CHECKED(x) { int err = x; if( err != 0 ) abort("KERNEL ERROR: Operation \"" #x "\" return error %d - %s\n", err, strerror(err)); }
     744
     745static void ?{}(__bin_sem_t & this) with( this ) {
     746        // Create the mutex with error checking
     747        pthread_mutexattr_t mattr;
     748        pthread_mutexattr_init( &mattr );
     749        pthread_mutexattr_settype( &mattr, PTHREAD_MUTEX_ERRORCHECK_NP);
     750        pthread_mutex_init(&lock, &mattr);
     751
     752        pthread_cond_init (&cond, (const pthread_condattr_t *)0p);  // workaround trac#208: cast should not be required
     753        val = 0;
     754}
     755
     756static void ^?{}(__bin_sem_t & this) with( this ) {
     757        CHECKED( pthread_mutex_destroy(&lock) );
     758        CHECKED( pthread_cond_destroy (&cond) );
     759}
     760
     761#undef CHECKED
    738762
    739763#if defined(__CFA_WITH_VERIFY__)
Note: See TracChangeset for help on using the changeset viewer.