treewide: improve mutex handling

- Add dawn_mutex_require() to indicate when code is accessing resources
- Use pthread_mutex_trylock() to actively test required mutex are locked

[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
Ian Clowes 2022-01-31 11:38:50 +00:00 committed by Nick Hainke
parent 32d6d6d57d
commit 60ea5b4daf
6 changed files with 200 additions and 36 deletions

View file

@ -11,6 +11,18 @@
#include "test_storage.h"
/*** Test Stub Functions - Called by SUT ***/
// It is an accident of Uni* / C history that the below is not stubbed in libc...
int pthread_mutex_trylock(pthread_mutex_t* m)
{
return EBUSY; // Tell SUT that it was locked, so no errors, warnings, etc
}
void ubus_set_nr_from_clients(struct kicking_nr* ap_list) {
printf("ubus_set_nr_from_clients() was called...\n");
}
void ubus_send_beacon_request(client *c, ap *a, int id)
{
printf("ubus_send_beacon_request() was called...\n");