/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version: 1.3.21
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */


Class name: Synch extends: SwigProxy fields: swigCPtrForSynch, swigCMemoryOwn {

  Method [ pvtSetCPtr: newCPtr memoryOwn: newCMemoryOwn
    swigCMemoryOwn := newCMemoryOwn.
    swigCPtrForSynch := newCPtr.
  ]

  Method [ getCPtrForSynch
    ^swigCPtrForSynch
  ]


  Function [ new
    self noDefaultConstructorError
  ]

  Method[ swigFinalize
    super swigFinalize.
    self delete.
  ]

  Method [ delete 
    (swigCMemoryOwn and:[ swigCPtrForSynch ~~ 0 ]) ifTrue:[
      swigCMemoryOwn := false.
      CslNI cslNI_delete_Synch: swigCPtrForSynch.
    ].
    swigCPtrForSynch := 0.
  ]

  Function[ getCPtr: obj
     obj isNil ifTrue:[^0].
     ^obj getCPtrForSynch
  ]

  Function [ makeSynch 
    |cPtr|
    cPtr := CslNI cslNI_Synch_MakeSynch.
    ^(cPtr == 0) ifTrue:[ nil ] ifFalse:[ Synch fromPointer: cPtr memoryOwn: false ]
  ]

  Method [ lock 
    ^CslNI cslNI_Synch_lock: swigCPtrForSynch 
  ]

  Method [ unlock 
    ^CslNI cslNI_Synch_unlock: swigCPtrForSynch 
  ]

  Method [ condWait 
    ^CslNI cslNI_Synch_condWait: swigCPtrForSynch 
  ]

  Method [ condSignal 
    ^CslNI cslNI_Synch_condSignal: swigCPtrForSynch 
  ]

}
