Project

General

Profile

Revision 1138

Fixed synchronization
Tested robustness

View differences:

dragonfly_lib.h
103 103
/** @brief shortcut for ATOMIC_BLOCK(ATOMIC_RESTORESTATE) **/
104 104
#define SYNC ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
105 105

  
106
/** @brief atomically grab a lock if it is free, return otherwise **/
107
#define REQUIRE_LOCK_OR_RETURN(LOCK) do { SYNC { if (LOCK) return; LOCK=1; } } while (0)
106 108

  
109
/** @brief atomically release a lock **/
110
#define RELEASE_LOCK(LOCK) do { LOCK=0; } while (0)
111

  
112

  
113

  
107 114
#endif
108 115

  

Also available in: Unified diff