Changeset 2299 for trunk/src/emx/include


Ignore:
Timestamp:
Aug 22, 2005, 3:56:25 AM (20 years ago)
Author:
bird
Message:

Merged the signal semaphore handling into the safe sems and made signals use them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/InnoTekLIBC/backend.h

    • Property cvs2svn:cvs-rev changed from 1.31 to 1.32
    r2298 r2299  
    967967 * @{ */
    968968
    969 /** 
     969/**
    970970 * Safe Mutex Semaphore structure.
    971971 *
    972  * For shared semaphores this structure must be in shared memory so all users 
     972 * For shared semaphores this structure must be in shared memory so all users
    973973 * actually use the very same structure.
    974974 */
     
    977977#ifdef __OS2__
    978978    /** Mutex handle. */
    979     unsigned long hmtx;
    980 #endif
     979    unsigned long       hmtx;
     980#endif
     981    /** Set if the semaphore is shared. */
     982    unsigned            fShared;
    981983} __LIBC_SAFESEMMTX;
    982984/** Pointer to a SAFESEM Mutex structure. */
     
    10301032
    10311033
    1032 /** 
     1034/**
    10331035 * Safe Event Semaphore structure.
    10341036 *
    1035  * For shared semaphores this structure must be in shared memory so all users 
     1037 * For shared semaphores this structure must be in shared memory so all users
    10361038 * actually use the very same structure.
    10371039 *
    1038  * @remark  The event semaphore business is difficult because the lack of 
    1039  *          atomic mutex release + event wait apis in OS/2. We have to 
     1040 * @remark  The event semaphore business is difficult because the lack of
     1041 *          atomic mutex release + event wait apis in OS/2. We have to
    10401042 *          jump around the place to get this working nearly safly...
    10411043 */
     
    10451047    /** The event semaphore. */
    10461048    unsigned long       hev;
    1047 #endif 
     1049#endif
    10481050    /** Number of threads which are supposed to be blocking on the above event semaphore. */
    10491051    uint32_t volatile   cWaiters;
    10501052    /** The mutex semaphore used to protect the event semaphore. */
    10511053    __LIBC_PSAFESEMMTX  pmtx;
    1052     /** Set if the semaphore is shared.
    1053      * If shared this structure is allocated from SPM, else it's from the heap. */
     1054    /** Set if the semaphore is shared. */
    10541055    unsigned            fShared;
    10551056} __LIBC_SAFESEMEV;
     
    10711072 * Opens a shared safe event sem.
    10721073 *
    1073  * The caller is responsible for opening the associated mutex 
     1074 * The caller is responsible for opening the associated mutex
    10741075 * semaphore before calling this function.
    10751076 *
     
    10921093 * Sleep on a semaphore.
    10931094 *
    1094  * The caller must own the associated mutex semaphore. The mutex semaphore will 
    1095  * be released as we go to sleep and reclaimed when we wake up. 
    1096  *
    1097  * The pfnComplete callback is used to correct state before signals are handled. 
     1095 * The caller must own the associated mutex semaphore. The mutex semaphore will
     1096 * be released as we go to sleep and reclaimed when we wake up.
     1097 *
     1098 * The pfnComplete callback is used to correct state before signals are handled.
    10981099 * It will always be called be for this function returns, and it'll either be under
    10991100 * the protection of the signal mutex or the associated mutex (both safe sems).
    11001101 *
    1101  * This is the most difficult thing we're doing in this API. On OS/2 we have 
     1102 * This is the most difficult thing we're doing in this API. On OS/2 we have
    11021103 * potential (at least theoretically) race conditions...
    11031104 *
Note: See TracChangeset for help on using the changeset viewer.