~ubuntu-branches/ubuntu/utopic/suricata/utopic

« back to all changes in this revision

Viewing changes to src/util-atomic.h

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2010-09-29 10:02:52 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100929100252-2ak252422dwsqs7e
Tags: 1.0.2-1
New Upstream version 1.0.2 (Closes: #598389)

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    SCSpinlock name ## _sc_lock__
55
55
 
56
56
/**
 
57
 *  \brief wrapper to reference an atomic variable already declared on another file (including the spin lock)
 
58
 *
 
59
 */
 
60
#define SC_ATOMIC_EXTERN(type, name) \
 
61
    extern type name ## _sc_atomic__; \
 
62
    extern SCSpinlock name ## _sc_lock__
 
63
 
 
64
/**
57
65
 *  \brief wrapper to declare an atomic variable including a (spin) lock
58
66
 *         to protect it and initialize them.
59
67
 */
200
208
    type name ## _sc_atomic__
201
209
 
202
210
/**
 
211
 *  \brief wrapper for referencing an atomic variable declared on another file.
 
212
 *
 
213
 *  \warning Only char, short, int, long, long long and their unsigned
 
214
 *           versions are supported.
 
215
 *
 
216
 *  \param type Type of the variable (char, short, int, long, long long)
 
217
 *  \param name Name of the variable.
 
218
 *
 
219
 *  We just declare the variable here as we rely on atomic operations
 
220
 *  to modify it, so no need for locks.
 
221
 *
 
222
 */
 
223
#define SC_ATOMIC_EXTERN(type, name) \
 
224
    extern type name ## _sc_atomic__
 
225
 
 
226
/**
203
227
 *  \brief wrapper for declaring an atomic variable and initializing it.
204
228
 **/
205
229
#define SC_ATOMIC_DECL_AND_INIT(type, name) \