3 * Copyright (c) 2001-2002, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
13 SV *sv; /* The actual SV */
14 perl_mutex mutex; /* Our mutex */
15 perl_cond cond; /* Our condition variable */
16 perl_cond user_cond; /* For user-level conditions */
17 IV locks; /* Number of locks held */
18 PerlInterpreter *owner; /* Who owns the lock? */
19 U16 index; /* Update index */
22 #define SHAREDSvGET(a) (a->sv)
23 #define SHAREDSvLOCK(a) Perl_sharedsv_lock(aTHX_ a)
24 #define SHAREDSvUNLOCK(a) Perl_sharedsv_unlock(aTHX_ a)
26 #define SHAREDSvEDIT(a) STMT_START { \
27 MUTEX_LOCK(&PL_sharedsv_space_mutex); \
29 PERL_SET_CONTEXT(PL_sharedsv_space); \
32 #define SHAREDSvRELEASE(a) STMT_START { \
33 PERL_SET_CONTEXT((a)->owner); \
34 SHAREDSvUNLOCK((a)); \
35 MUTEX_UNLOCK(&PL_sharedsv_space_mutex); \
38 #endif /* USE_ITHREADS */