/* ----------------------------------------------------------------------------
 * 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: Thread extends: SwigProxy fields: swigCPtrForThread, swigCMemoryOwn {

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

  Method [ getCPtrForThread
    ^swigCPtrForThread
  ]


  Function [ new
    self noDefaultConstructorError
  ]

  Method[ swigFinalize
    super swigFinalize.
    self delete.
  ]

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

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

  Function [ makeThread 
    |cPtr|
    cPtr := CslNI cslNI_Thread_MakeThread.
    ^(cPtr == 0) ifTrue:[ nil ] ifFalse:[ Thread fromPointer: cPtr memoryOwn: false ]
  ]

  Method [ createThread: func args: args 
    ^CslNI cslNI_Thread_createThread: swigCPtrForThread with: (SwigTypePfpvoidpvoid getCPtr: func) with: (SwigTypePvoid getCPtr: args)
  ]

  Method [ createRealtimeThread: func args: args 
    ^CslNI cslNI_Thread_createRealtimeThread: swigCPtrForThread with: (SwigTypePfpvoidpvoid getCPtr: func) with: (SwigTypePvoid getCPtr: args)
  ]

}
