• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSWorkspace race condition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWorkspace race condition


  • Subject: NSWorkspace race condition
  • From: Steve Gehrman <email@hidden>
  • Date: Wed, 16 May 2001 18:32:55 -0700

I have stumbled upon a race condition that causes my app to hang. Is there something I'm doing wrong, or is this a bug in Cocoa?

It's very simple to reproduce: My app is set to be notified when a disk mounts with "NSWorkspaceDidMountNotification", When I insert a CDROM or Zip disk, the notification happens, and I call code to update my internal representation of all mounted volumes. This code eventually calls...

[[NSWorkspace sharedWorkspace] isFilePackageAtPath:filePath];

This causes the program to hang in semaphore_wait_trap and I get the spinning rainbow cursor.

Are there restrictions on what you can and can't call when you get notifications?

Heres the Frame info from the debugger if that helps

0 semaphore_wait_trap
1 semaphore_wait
2 pthread_mutex_lock
3 TSLockMutex
4 AcquireVolumeListLock
5 MountVolume
6 FindOrMountVolumeByExactMountPointName
7 ResolveSyntheticAliasFile
8 ... 13
14 [NSWorkspace isFilePackageAtPath]

steve


  • Follow-Ups:
    • Re: NSWorkspace race condition
      • From: Deirdre Saoirse Moen <email@hidden>
  • Prev by Date: Programatically making a particular text field active?
  • Next by Date: Re: Dockling icon
  • Previous by thread: Re: Programatically making a particular text field active?
  • Next by thread: Re: NSWorkspace race condition
  • Index(es):
    • Date
    • Thread