sys_proc_mutex_unlock () automatically reschedule at the end
All checks were successful
Build documentation / build-and-deploy (push) Successful in 29s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 29s
This commit is contained in:
@@ -13,7 +13,6 @@ void mythread (void) {
|
|||||||
for (size_t i = 0; i < 3; i++)
|
for (size_t i = 0; i < 3; i++)
|
||||||
proc_test ('b');
|
proc_test ('b');
|
||||||
proc_mutex_unlock (mutex_rid);
|
proc_mutex_unlock (mutex_rid);
|
||||||
proc_sched ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +39,5 @@ void app_main (void) {
|
|||||||
for (size_t i = 0; i < 3; i++)
|
for (size_t i = 0; i < 3; i++)
|
||||||
proc_test ('a');
|
proc_test ('a');
|
||||||
proc_mutex_unlock (mutex_rid);
|
proc_mutex_unlock (mutex_rid);
|
||||||
proc_sched ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,13 @@ DEFINE_SYSCALL (sys_proc_mutex_unlock) {
|
|||||||
if (resource == NULL)
|
if (resource == NULL)
|
||||||
return -SR_NOT_FOUND;
|
return -SR_NOT_FOUND;
|
||||||
|
|
||||||
return proc_mutex_unlock (proc, &resource->u.mutex) ? SR_OK : -SR_PERMISSION_ERROR;
|
int result = proc_mutex_unlock (proc, &resource->u.mutex) ? SR_OK : -SR_PERMISSION_ERROR;
|
||||||
|
if (result < 0)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
proc_sched (regs);
|
||||||
|
|
||||||
|
return SR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* int proc_drop_resource (int rid) */
|
/* int proc_drop_resource (int rid) */
|
||||||
|
|||||||
Reference in New Issue
Block a user