Redesign scheduling points
All checks were successful
Build documentation / build-and-deploy (push) Successful in 35s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 35s
This commit is contained in:
@@ -123,7 +123,8 @@ DEFINE_SYSCALL (sys_mutex_delete) {
|
||||
if (mutex_resource == NULL)
|
||||
return SYSRESULT (-ST_NOT_FOUND);
|
||||
|
||||
proc_delete_resource (mutex_resource);
|
||||
if (proc_delete_resource (mutex_resource) == PROC_NEED_RESCHEDULE)
|
||||
proc_sched ();
|
||||
|
||||
return SYSRESULT (ST_OK);
|
||||
}
|
||||
@@ -137,7 +138,8 @@ DEFINE_SYSCALL (sys_mutex_lock) {
|
||||
if (mutex_resource == NULL)
|
||||
return SYSRESULT (-ST_NOT_FOUND);
|
||||
|
||||
proc_mutex_lock (proc, &mutex_resource->u.mutex);
|
||||
if (proc_mutex_lock (proc, &mutex_resource->u.mutex) == PROC_NEED_RESCHEDULE)
|
||||
proc_sched ();
|
||||
|
||||
return SYSRESULT (ST_OK);
|
||||
}
|
||||
@@ -151,8 +153,10 @@ DEFINE_SYSCALL (sys_mutex_unlock) {
|
||||
if (mutex_resource == NULL)
|
||||
return SYSRESULT (-ST_NOT_FOUND);
|
||||
|
||||
return SYSRESULT (proc_mutex_unlock (proc, &mutex_resource->u.mutex) ? ST_OK
|
||||
: -ST_PERMISSION_ERROR);
|
||||
if (proc_mutex_unlock (proc, &mutex_resource->u.mutex) == PROC_NEED_RESCHEDULE)
|
||||
proc_sched ();
|
||||
|
||||
return SYSRESULT (ST_OK);
|
||||
}
|
||||
|
||||
static syscall_handler_func_t handler_table[] = {
|
||||
|
||||
Reference in New Issue
Block a user