Go to the documentation of this file.
36 assert(_sem &&
"Invalid argument");
38 sem =
malloc(
sizeof(*sem));
46 INIT_LIST_HEAD(&sem->
list);
58 assert(_sem &&
"Invalid argument");
84 assert(_sem &&
"Invalid argument");
92 if (++sem->
value >= 0) {
97 if (pos == &sem->
list) {
104 assert((sem == info->
tcb->
sem) &&
"Sempahore is not matched");
118 assert(_sem &&
"Invalid argument");
126 if (--sem->
value < 0) {
129 info =
malloc(
sizeof(*info));
141 list_add_tail(&info->
head, &sem->
list);
143 while (sem->
value < 0) {
156 assert(_sem &&
"Invalid argument");
164 if ((sem->
value - 1) < 0) {
176 assert(_sem &&
"Invalid argument");
189 assert(val && _sem &&
"Invalid argument");
218 if (info->
tcb == tcb) {