Demo entry 6354224

test

   

Submitted by lin on Apr 05, 2017 at 17:23
Language: C. Code size: 249 Bytes.

struct semaphore{
	Int count;
	queueType queue;
};
void semWait (semaphore s){
	s.count--;
	if(s.count < 0){
		/*把当前进程插入到队列当中,阻塞当前进程*/
	}
}

void semSignal (semaphore s){
	s.count++;
	if (s.count <= 0){
		/* 把进程p从队列移除,插入到就绪队列 */
	}
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).