50 fiber_tbox(
bool free_obj =
true) : size_(0), free_obj_(free_obj) {}
61 void clear(
bool free_obj =
false)
64 for (
typename std::list<T*>::iterator it =
65 tbox_.begin(); it != tbox_.end(); ++it) {
84 bool push(T* t,
bool notify_first =
true)
87 if (event_.
wait() ==
false) {
96 if (cond_.
notify() ==
false) {
99 if (event_.
notify() ==
false) {
104 if (event_.
notify() ==
false) {
107 if (cond_.
notify() ==
false) {
127 T*
pop(
int wait_ms = -1,
bool* found = NULL)
130 if (event_.
wait() ==
false) {
134 T* t = peek(found_flag);
136 if (event_.
notify() ==
false) {
146 if (!cond_.
wait(event_, wait_ms) && wait_ms >= 0) {
147 if (event_.
notify() ==
false) {
170 if (event_.
wait() ==
false) {
177 if (event_.
notify() ==
false) {
193 T* peek(
bool& found_flag)
195 typename std::list<T*>::iterator it = tbox_.begin();
196 if (it == tbox_.end()) {
bool wait(fiber_event &event, int timeout=-1)
T * pop(int wait_ms=-1, bool *found=NULL)
bool push(T *t, bool notify_first=true)
fiber_tbox(bool free_obj=true)
void clear(bool free_obj=false)