diff options
author | bje <bje> | 1998-07-20 06:38:09 +0000 |
---|---|---|
committer | bje <bje> | 1998-07-20 06:38:09 +0000 |
commit | 965c46cbb7cceec49293210c855f0401bbceab70 (patch) | |
tree | eb610326e00d07b5bec49f6cebeaf5821d331124 /misc.c | |
parent | 02048eae9107e7a34169b9c3d429a15523c1cdd2 (diff) |
1998-07-20 Ben Elliston <bje@cygnus.com>
* misc.c (pthread_once): Don't use a per-application flag and
mutex--make `pthread_once_t' contain these elements in their
structure. The earlier version had incorrect semantics.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -25,12 +25,12 @@ pthread_once(pthread_once_t *once_control, the DLL is unloaded. */ /* An atomic test-and-set of the "once" flag. */ - EnterCriticalSection(&_pthread_once_lock); + EnterCriticalSection(once_control.lock); if (_pthread_once_flag == 0) { - flag = _pthread_once_flag = 1; + flag = once_control->flag = 1; } - LeaveCriticalSection(&_pthread_once_lock); + LeaveCriticalSection(once_control.lock); if (flag) { |