• 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
Ejecting a volume in seperate thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ejecting a volume in seperate thread


  • Subject: Ejecting a volume in seperate thread
  • From: alon b <email@hidden>
  • Date: Sat, 28 Jun 2003 10:33:47 -0700 (PDT)

I am trying to eject a volume, my code (the Eject function) works fine when running in the main application thread but when called through NSConnection from on a "work" thread the function never returns i.e. NSBeep is never reached. Any ideas ?

@implementation SDKServer



- (oneway void)Eject

{

pid_t pid;

FSVolumeRefNum actualVolume = xxx; //xxx is the actual volume number

OSErr result = FSEjectVolumeSync(actualVolume, 0, &pid);

NSBeep();

}

+ (void)connectWithPorts:(NSArray *)portArray

{

NSAutoreleasePool *pool;

NSConnection *connectionToController;

ETSDKServer *serverObject;

pool = [[NSAutoreleasePool alloc] init];

connectionToController = [NSConnection connectionWithReceivePort:[portArray objectAtIndex:0]

sendPort:[portArray objectAtIndex:1]];

serverObject = [[self alloc] init];

id client = [connectionToController rootProxy];

[client SetServer:serverObject];

[serverObject release];

[[NSRunLoop currentRunLoop] run];

[pool release];

}



@end





Thanx



Alonb
SBC Yahoo! DSL - Now only $29.95 per month!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Drawing text with NSLayoutManager
  • Next by Date: NSStatusItem screen flicker
  • Previous by thread: Re: iTunes & AppleScript
  • Next by thread: NSStatusItem screen flicker
  • Index(es):
    • Date
    • Thread