Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e45d2d7101da0c0f935625ce3459fc4f0185b5e2d5f9b95df6fe12dac5aa95b2
Ticket: 7f3321da83ae25134cac8569f14c707e8651ef37
os_unfair_lock instead of OSSpinLock on macOS >= 10.12
User & Date: anonymous on 2019-07-23 15:49:27
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    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
    
  5. is_private changed to: "0"
  6. login: "anonymous"
  7. priority changed to: "5 Medium"
  8. private_contact changed to: "10e302b1a1ae78d60a0878d87bdb4b5f874b815e"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "anonymous"
  13. subsystem changed to: "01. Notifier"
  14. title changed to:
    os_unfair_lock instead of OSSpinLock on macOS >= 10.12
    
  15. type changed to: "Patch"