online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
int queue_put(BlockingQueue * queue, void * data) { pthread_mutex_lock(&queue->lock); struct QNode * first = queue->first; struct QNode * new_; if(first != NULL) { while(first != NULL) { first = first->next; } make_node(data, &new_); } else { make_node(data, &new_); } if(new_ != NULL) { first = new_; } else { return 0; pthread_mutex_unlock(&queue->lock); } queue->nodes += 1; pthread_cond_signal(&queue->empty_); pthread_mutex_unlock(&queue->lock); return 1; } void * queue_pop(BlockingQueue * queue) { pthread_mutex_lock(&queue->lock); while(!queue->empty_) { pthread_cond_wait(&queue->empty_, &queue->lock); } struct QNode * first = queue->first; void * data_; if(first->next != NULL) { struct QNode * next = first->next; data_ = first->next->data; queue->first = next; } else { data_ = first->data; } first = NULL; first->next = NULL; free(first); queue->nodes -= 1; pthread_mutex_lock(&queue->lock); return data_; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue