Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2020-07-18
17:48 • Closed ticket [7f3321da83]: os_unfair_lock instead of OSSpinLock on macOS >= ... artifact: 0fe29dd69f user: marc_culler
17:24 • Ticket [7f3321da83]: 3 changes artifact: 0fa5e94156 user: anonymous
17:13 • Ticket [7f3321da83]: 4 changes artifact: 4e6e4795c2 user: chrstphrchvz
2020-06-22
18:13 • Ticket [7f3321da83]: 3 changes artifact: 13f754e909 user: chrstphrchvz
2019-07-23
15:49 • New ticket [7f3321da83]. artifact: e45d2d7101 user: anonymous

os_unfair_lock instead of OSSpinLock on macOS >= 10.12

Closed / Fixed7f3321da83ae25134cac8569f14c707e8651ef37Created 7 years agoUpdated 6 years ago
Descriptionplain2019-07-23 15:49:27
OSSpinLock is deprecated on macOS 10.12,  so this is an attempt to silent compiler

sorry but I don't know exactly how to use diff

diff /Users/nico/Desktop/tclMacOSXNotify.c /Users/nico/daylight/lib/framework/tcl-50a5729f85/macosx/tclMacOSXNotify.c
39,42d38
< #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
< #include <os/lock.h>
< #define _USE_OS_UNFAIR_LOCK 1
< #endif
88,92d83
< #ifdef _USE_OS_UNFAIR_LOCK
< #define SpinLockLock(p)     os_unfair_lock_lock(p)
< #define SpinLockUnlock(p)    os_unfair_lock_unlock(p)
< #define SpinLockTry(p)        os_unfair_lock_trylock(p)
< #else
96d86
< #endif /* _USE_OS_UNFAIR_LOCK */
120,123d109
< #ifdef _USE_OS_UNFAIR_LOCK
< static os_unfair_lock notifierInitLock = (OS_UNFAIR_LOCK_INIT);
< static os_unfair_lock notifierLock     = (OS_UNFAIR_LOCK_INIT);
< #else
126d111
< #endif
132,137c117,122
< #define LOCK_NOTIFIER_INIT    SpinLockLock(&notifierInitLock)
< #define UNLOCK_NOTIFIER_INIT    SpinLockUnlock(&notifierInitLock)
< #define LOCK_NOTIFIER        SpinLockLock(&notifierLock)
< #define UNLOCK_NOTIFIER        SpinLockUnlock(&notifierLock)
< #define LOCK_NOTIFIER_TSD    SpinLockLock(&tsdPtr->tsdLock)
< #define UNLOCK_NOTIFIER_TSD    SpinLockUnlock(&tsdPtr->tsdLock)
---
> #define LOCK_NOTIFIER_INIT    SpinLockLock(&notifierInitLock)
> #define UNLOCK_NOTIFIER_INIT  SpinLockUnlock(&notifierInitLock)
> #define LOCK_NOTIFIER     SpinLockLock(&notifierLock)
> #define UNLOCK_NOTIFIER       SpinLockUnlock(&notifierLock)
> #define LOCK_NOTIFIER_TSD SpinLockLock(&tsdPtr->tsdLock)
> #define UNLOCK_NOTIFIER_TSD   SpinLockUnlock(&tsdPtr->tsdLock)
287,296c272,274
< #ifdef _USE_OS_UNFAIR_LOCK
<     os_unfair_lock tsdLock;        /* Must hold this lock before acessing the
<                                 * following fields from more than one
<                                 * thread. */
< #else
<     OSSpinLock tsdLock;        /* Must hold this lock before acessing the
<                                 * following fields from more than one
<                                 * thread. */
< #endif
<
---
>     OSSpinLock tsdLock;       /* Must hold this lock before acessing the
>                * following fields from more than one
>                * thread. */
553,555d530
< #ifdef _USE_OS_UNFAIR_LOCK
<         tsdPtr->tsdLock = OS_UNFAIR_LOCK_INIT;
< #else
557d531
< #endif
chrstphrchvzwiki2020-06-22 18:13:47

Possibly in progress, see [7c6642e5f3dd]

chrstphrchvzwiki2020-07-18 17:13:08

Resolved by the macOS_hangs branch (see [a58737f57b]) merged into core-8-6-branch. How should this be marked as resolved?

anonymousplain2020-07-18 17:24:13
Hi Christopher,
yes, it's resolved and works ok.

thanks,
++
marc_culler (claiming to be Marc Culler)plain2020-07-18 17:48:32
I am closing this now and marking it as FIXED.  There was more work
required than was provided in the patch.  And it wasn't really a bug,
just a deprecation. But I am reclassifying it as a bug so I don't
have to figure out what it means to fix an RFE.

Thanks for remembering about this ticket!
Log in (anonymous is fine) to add a comment.