Ignore:
Timestamp:
Jun 13, 2005, 11:29:07 PM (20 years ago)
Author:
bird
Message:

Auto init fmutexes. fixed deadlock for the must-complete variant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/sys/fmutex.h

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r2026 r2027  
    66
    77#ifndef _SYS_FMUTEX_H
    8     #define _SYS_FMUTEX_H
     8#define _SYS_FMUTEX_H
    99
    10     #include <sys/cdefs.h>
    11     #include <stdlib.h> /* need abort */
    12     #include <InnoTekLIBC/FastInfoBlocks.h>
     10#include <sys/cdefs.h>
     11#include <stdlib.h> /* need abort */
     12#include <InnoTekLIBC/FastInfoBlocks.h>
     13#include <386/builtin.h>
    1314
    1415__BEGIN_DECLS
     
    1617/* Constants for _fmutex.fs.  See _fmutex_available() for ordering. */
    1718
    18     #define _FMS_UNINIT       0
    19     #define _FMS_AVAILABLE    1
    20     #define _FMS_OWNED_SIMPLE 2
    21     #define _FMS_OWNED_HARD   3
     19#define _FMS_AUTO_INITIALIZE    (-1)
     20#define _FMS_UNINIT       0
     21#define _FMS_AVAILABLE    1
     22#define _FMS_OWNED_SIMPLE 2
     23#define _FMS_OWNED_HARD   3
    2224
    2325/* Constants for _fmutex_create() */
    2426
    25     #define _FMC_SHARED         0x01
    26     #define _FMC_MUST_COMPLETE  0x02
    27     #define _FMC_DUMMY          0x04    /* internal */
     27#define _FMC_SHARED         0x01
     28#define _FMC_MUST_COMPLETE  0x02
     29#define _FMC_DUMMY          0x04    /* internal */
    2830
    2931/* Constants for _fmutex_request() */
    3032
    31     #define _FMR_IGNINT     0x01
    32     #define _FMR_NOWAIT     0x02
     33#define _FMR_IGNINT     0x01
     34#define _FMR_NOWAIT     0x02
    3335
    3436/* We cannot use __attribute__ ((__packed__)) because G++ does not
    3537   support this. */
    3638
    37     #pragma pack(1)
     39#pragma pack(1)
    3840typedef struct
    3941{
     
    5153    const char             *pszDesc;
    5254} _fmutex;
    53     #pragma pack()
     55#pragma pack()
    5456
     57#define _FMUTEX_INITIALIZER                         _FMUTEX_INITIALIZER_EX(0, __FILE__)
     58#define _FMUTEX_INITIALIZER_EX(fFlags, pszDesc)     { 0, _FMS_AUTO_INITIALIZE, fFlags, {0x42,0x42}, 0, pszDesc }
    5559
    5660
Note: See TracChangeset for help on using the changeset viewer.