5
* The function pointers are supplied by the thread
6
* library during its initialization. If there is no thread
7
* library, there is no multithreading.
10
int (*_lock)(Lock*, int, ulong);
11
void (*_unlock)(Lock*, ulong);
12
int (*_qlock)(QLock*, int, ulong); /* do not use */
13
void (*_qunlock)(QLock*, ulong);
14
void (*_rsleep)(Rendez*, ulong); /* do not use */
15
int (*_rwakeup)(Rendez*, int, ulong);
16
int (*_rlock)(RWLock*, int, ulong); /* do not use */
17
int (*_wlock)(RWLock*, int, ulong);
18
void (*_runlock)(RWLock*, ulong);
19
void (*_wunlock)(RWLock*, ulong);
26
(*_lock)(l, 1, getcallerpc(&l));
37
return (*_lock)(l, 0, getcallerpc(&l));
53
(*_unlock)(l, getcallerpc(&l));
64
(*_qlock)(l, 1, getcallerpc(&l));
75
return (*_qlock)(l, 0, getcallerpc(&l));
91
(*_qunlock)(l, getcallerpc(&l));
102
(*_rlock)(l, 1, getcallerpc(&l));
113
return (*_rlock)(l, 0, getcallerpc(&l));
129
(*_runlock)(l, getcallerpc(&l));
140
(*_wlock)(l, 1, getcallerpc(&l));
142
l->writer = (void*)1;
151
return (*_wlock)(l, 0, getcallerpc(&l));
153
if(l->writer || l->readers)
155
l->writer = (void*)1;
167
(*_wunlock)(l, getcallerpc(&l));
178
(*_rsleep)(r, getcallerpc(&r));
187
return (*_rwakeup)(r, 0, getcallerpc(&r));
193
rwakeupall(Rendez *r)
197
return (*_rwakeup)(r, 1, getcallerpc(&r));