     
     deinit {
         pthread_mutex_destroy(self.lock)
-        self.lock.destroy()
+        self.lock.dealloc(sizeof(pthread_mutex_t))
     }
     
     class var sharedInstance : _BigSTMLock {


    deinit {
        pthread_cond_destroy(self.cond)
        self.cond.destroy()
        _IDGenerator.sharedInstance.freeID(self.id)
    }


                }
            }
        }

        return res
    }
    
