Changes between Version 7 and Version 8 of ThreadCommunication


Ignore:
Timestamp:
Apr 20, 2011 2:03:33 PM (10 years ago)
Author:
levin@chromium.org
Comment:

Filled in api for sync case.

Legend:

Unmodified
Added
Removed
Modified
  • ThreadCommunication

    v7 v8  
    4848{{{
    4949    // getProxy is a method in the current object which returns its proxy. The proxy may be used with invoke like these examples.
    50     proxy->invoke(&TypeName::method, arg1, getProxy(), arg3, ...);
     50    proxy->invokeWithCallback(this, &TypeName::method, arg1, arg2, arg3, ...);
    5151}}}
     52
     53The resulting call on TypeName::method should look identical to that done with invokeSync.  (The other side doesn't care and should indicate when it is "done" so it may be used in either way.)
    5254
    5355
    5456Case 3: A thread wants to call a function on another thread and wait until it is done.
    5557
    56 TBD
     58{{{
     59    OwnPtr<SyncWaiter> syncCall = proxy->invokeSync(this, &TypeName::method,  arg1, arg2, arg3, ...);
     60    syncCall.wait();
     61}}}
     62
    5763
    5864'''Case study: File API from Workers'''
     
    102108void WorkerFileSystemCallbacks::postMoveToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode)
    103109{
    104     OwnPtr<SyncWaiter> syncCall = mainThreadMessageLoop->invokeSync(&moveOnMainThread, fileSystem, sourcePath, destinationPath);
     110    OwnPtr<SyncWaiter> syncCall = mainThreadMessageLoop->invokeSync(this, &moveOnMainThread, fileSystem, sourcePath, destinationPath);
    105111    syncCall.wait();
    106112    stop();
    107113}
    108114}}}
     115
     116This introduced a way to to call a function on the other thread (Messageloop::invokeSync).
     117
     118
     119'''Detailed api breakdown'''
     120
     121TBD