struct SilcFSMSemaObject {
SilcFSM fsm; /* Machine */
SilcList waiters; /* List of SilcFSM pointers */
struct SilcFSMSemaObject {
SilcFSM fsm; /* Machine */
SilcList waiters; /* List of SilcFSM pointers */
- SilcUInt32 value; /* Current semaphore value */
+ unsigned int value : 21; /* Current semaphore value */
+ unsigned int refcnt : 10; /* Reference counter */
+ unsigned int allocated : 1; /* Set if allocated */
SilcSchedule schedule; /* Scheduler */
SilcFSMSema sema; /* Valid if waiting sema timeout */
SilcFSMStateCallback next_state; /* Next state in machine */
SilcSchedule schedule; /* Scheduler */
SilcFSMSema sema; /* Valid if waiting sema timeout */
SilcFSMStateCallback next_state; /* Next state in machine */
/* Used internally by the SILC_FSM_CALL macros to detect whether async
call is really async or not. */
static inline
/* Used internally by the SILC_FSM_CALL macros to detect whether async
call is really async or not. */
static inline
/* Wait for thread to terminate */
SilcBool silc_fsm_thread_wait(void *fsm, void *thread);
/* Semaphores */
SilcUInt32 silc_fsm_sema_wait(SilcFSMSema sema, void *fsm);
SilcUInt32 silc_fsm_sema_timedwait(SilcFSMSema sema, void *fsm,
/* Wait for thread to terminate */
SilcBool silc_fsm_thread_wait(void *fsm, void *thread);
/* Semaphores */
SilcUInt32 silc_fsm_sema_wait(SilcFSMSema sema, void *fsm);
SilcUInt32 silc_fsm_sema_timedwait(SilcFSMSema sema, void *fsm,