Changeset 76

Show
Ignore:
Timestamp:
05/14/07 20:19:09 (2 years ago)
Author:
tkreger
Message:

Steve Morkis patch to enable asynch rather than blocking on the read pipe

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libp5glove/trunk/src/usb_hid_macosx.c

    r69 r76  
    271271    } 
    272272 
     273 
     274    // prepare async source for ReadPipeAsync 
     275  // patched by Steve Morkis 
     276    CFRunLoopSourceRef cfSource; 
     277    err = (*intf)->CreateInterfaceAsyncEventSource(intf, &cfSource); 
     278 
     279    CFRunLoopAddSource(CFRunLoopGetCurrent(), cfSource, kCFRunLoopDefaultMode); 
     280 
     281 
     282 
     283    // prepare async source for ReadPipeAsync 
     284  // patched by Steve Morkis 
     285    CFRunLoopSourceRef cfSource; 
     286    err = (*intf)->CreateInterfaceAsyncEventSource(intf, &cfSource); 
     287 
     288    CFRunLoopAddSource(CFRunLoopGetCurrent(), cfSource, kCFRunLoopDefaultMode); 
     289 
     290 
    273291    return intf; 
    274292} 
     
    292310    UInt32 readSize = count; 
    293311     
    294     (*intf)->ReadPipe(intf, 1,  data, &readSize ); // 1 should be inPipeRef 
     312    (*intf)->ReadPipeAsync(intf, 1, data, readSize, (IOAsyncCallback1)0, (void*)0); 
    295313     
    296314    return readSize;