Changes between Version 7 and Version 8 of ThreadCommunication
- Timestamp:
- Apr 20, 2011, 2:03:33 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ThreadCommunication
v7 v8 48 48 {{{ 49 49 // 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, ...); 51 51 }}} 52 53 The 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.) 52 54 53 55 54 56 Case 3: A thread wants to call a function on another thread and wait until it is done. 55 57 56 TBD 58 {{{ 59 OwnPtr<SyncWaiter> syncCall = proxy->invokeSync(this, &TypeName::method, arg1, arg2, arg3, ...); 60 syncCall.wait(); 61 }}} 62 57 63 58 64 '''Case study: File API from Workers''' … … 102 108 void WorkerFileSystemCallbacks::postMoveToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode) 103 109 { 104 OwnPtr<SyncWaiter> syncCall = mainThreadMessageLoop->invokeSync( &moveOnMainThread, fileSystem, sourcePath, destinationPath);110 OwnPtr<SyncWaiter> syncCall = mainThreadMessageLoop->invokeSync(this, &moveOnMainThread, fileSystem, sourcePath, destinationPath); 105 111 syncCall.wait(); 106 112 stop(); 107 113 } 108 114 }}} 115 116 This introduced a way to to call a function on the other thread (Messageloop::invokeSync). 117 118 119 '''Detailed api breakdown''' 120 121 TBD