sys_proc_mutex_unlock () automatically reschedule at the end
All checks were successful
Build documentation / build-and-deploy (push) Successful in 29s

This commit is contained in:
2026-01-16 00:28:46 +01:00
parent 711da8aeab
commit 9fc8521e63
2 changed files with 7 additions and 3 deletions

View File

@@ -13,7 +13,6 @@ void mythread (void) {
for (size_t i = 0; i < 3; i++)
proc_test ('b');
proc_mutex_unlock (mutex_rid);
proc_sched ();
}
}
@@ -40,6 +39,5 @@ void app_main (void) {
for (size_t i = 0; i < 3; i++)
proc_test ('a');
proc_mutex_unlock (mutex_rid);
proc_sched ();
}
}

View File

@@ -142,7 +142,13 @@ DEFINE_SYSCALL (sys_proc_mutex_unlock) {
if (resource == NULL)
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) */