Difference between revisions of "Uno/Spec/Thread Unsafety Bridge"

From Apache OpenOffice Wiki
< Uno‎ | Spec
Jump to: navigation, search
m (Improved style.)
m (Feature: Rephrased.)
Line 5: Line 5:
  
 
=== Feature ===
 
=== Feature ===
This [[../Bridge|bridge]] protects [[Uno/Term/Thread Unsafe|thread unsafe]] objects from being called by multi threads simultaneously. It does this by acquring a dedicated mutex before actually doing the call.
+
This [[../Bridge|bridge]] protects [[Uno/Term/Thread Unsafe|thread unsafe]] objects from being called by multiple threads concurrently. It does this by acquring a dedicated mutex before actually doing the call.
  
A [[../Purpose Bridge|purpose bridge]] protecting [[Uno/Term/Thread Unsafe|thread unsafe]] objects:
+
The purpose bridges behaves as follows,
* <code>enter</code>: Aquires the mutex of the associated [[../Environment|Environment]].
+
* entering the Unsafety Environment aquires the associated mutex, in case the mutex has already been acquired, the calling thread blocks until it has been released,
* <code>leave</code>: Releases the mutex of the associated [[../Environment|Environment]].
+
* leaveing the Unsafety Environment releases the associated mutex,
 
+
* calling into the Unsafey Environment, leads to the invocation of the passed function, after acquiring the associated mutex,
* <code>callInto</code>: Acquires the mutex of the associated [[../Environment|Environment]] and calls the desired method.
+
* calling out of the Unsafety Environment, leads to the invocation of the passed function, actually keeping the associated mutex acquired, therefor protecting any objects on the callers stack.
* <code>callOut </code>: Calls the desired method, while keeping the mutex of the associated [[../Environment|Environment]] acquired.
+
  
 
=== Rationale ===
 
=== Rationale ===

Revision as of 15:36, 16 June 2006

state: draft
type: specification

Thread Unsafety Bridge

Feature

This bridge protects thread unsafe objects from being called by multiple threads concurrently. It does this by acquring a dedicated mutex before actually doing the call.

The purpose bridges behaves as follows,

  • entering the Unsafety Environment aquires the associated mutex, in case the mutex has already been acquired, the calling thread blocks until it has been released,
  • leaveing the Unsafety Environment releases the associated mutex,
  • calling into the Unsafey Environment, leads to the invocation of the passed function, after acquiring the associated mutex,
  • calling out of the Unsafety Environment, leads to the invocation of the passed function, actually keeping the associated mutex acquired, therefor protecting any objects on the callers stack.

Rationale

API

Purpose bridge named ":unsafe".

Dependencies

Personal tools