Sha256: 570abe822d47ff45e2d2593eb8b76ef1639244e58ac761199f12171e2c3b308a
Contents?: true
Size: 587 Bytes
Versions: 35
Compression:
Stored size: 587 Bytes
Contents
#include "ioserver.h" using namespace LCBTest; Future::Future() { failed = false; } void Future::wait() { mutex.lock(); while (!isDone() && !failed) { cond.wait(mutex); } mutex.unlock(); } Future::~Future() { mutex.close(); cond.close(); } void Future::startUpdate() { mutex.lock(); } void Future::endUpdate() { if (shouldEnd()) { cond.signal(); } mutex.unlock(); } bool Future::checkDone() { bool ret; if (!mutex.tryLock()) { return false; } ret = isDone(); mutex.unlock(); return ret; }
Version data entries
35 entries across 35 versions & 2 rubygems