 
     deinit {
         pthread_cond_destroy(self.cond)
-        self.cond.destroy()
+        self.cond.dealloc(sizeof(pthread_cond_t))
         _IDGenerator.sharedInstance.freeID(self.id)
     }
 

                }
            }
        }
        return res
    }
    

    
    deinit {
        pthread_mutex_destroy(self.lock)
        self.lock.dealloc(sizeof(pthread_mutex_t))
    }
    
    class var sharedInstance : _IDGenerator {
