Squeak Class Documentation category index | class index  
 
ExternalSemaphoreTable
  category: System-Support
  superclass: Object
  subclasses:

By John M McIntosh johnmci@smalltalkconsulting.com
This class was written to mange the external semaphore table. When I was writing a Socket test server I discovered various race conditions on the access to the externalSemaphore table. This new class uses class side methods to restrict access using a mutex semaphore. It seemed cleaner to deligate the reponsibility here versus adding more code and another class variable to SystemDictionary

Note that in Smalltalk recreateSpecialObjectsArray we still directly play with the table.

instance methods
  no messages
 

class methods
  accessing
  clearExternalObjects
externalObjects
registerExternalObject:
safelyRegisterExternalObject:
safelyUnregisterExternalObject:
unregisterExternalObject:

  initialize
  initialize

instance methods
  no messages top  

class methods
  accessing top  
 

clearExternalObjects

Clear the array of objects that have been registered for use in non-Smalltalk code.


 

externalObjects


 

registerExternalObject:


 

safelyRegisterExternalObject:

Register the given object in the external objects array and return its index. If it is already there, just return its index.


 

safelyUnregisterExternalObject:

Unregister the given object in the external objects array. Do nothing if it isn't registered.
JMM change to return if we clear the element, since it should only appear once in the array


 

unregisterExternalObject:


  initialize top  
 

initialize

Object initialize