Skip to content

Commit

Permalink
mutex_lock_interruptible
Browse files Browse the repository at this point in the history
  • Loading branch information
calccrypto committed Jul 1, 2024
1 parent 62c1e58 commit 9b8600d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dpusm.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ dpusm_init(void) {

static void __exit
dpusm_exit(void) {
mutex_lock(&dpusm.lock);
mutex_lock_interruptible(&dpusm.lock);

const int active = atomic_read(&dpusm.active);
if (unlikely(active)) {
Expand Down
8 changes: 4 additions & 4 deletions src/provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ dpusm_provider_register(dpusm_t *dpusm, struct module *module, const dpusm_pf_t
return -EINVAL;
}

mutex_lock(&dpusm->lock);;
mutex_lock_interruptible(&dpusm->lock);;

dpusm_ph_t **found = find_provider(dpusm, module_name(module));
if (found) {
Expand Down Expand Up @@ -320,7 +320,7 @@ dpusm_provider_unregister_handle(dpusm_t *dpusm, dpusm_ph_t **provider) {

int
dpusm_provider_unregister(dpusm_t *dpusm, struct module *module) {
mutex_lock(&dpusm->lock);;
mutex_lock_interruptible(&dpusm->lock);;

dpusm_ph_t **provider = find_provider(dpusm, module_name(module));
if (!provider) {
Expand All @@ -345,7 +345,7 @@ dpusm_provider_unregister(dpusm_t *dpusm, struct module *module) {
/* get a provider by name */
dpusm_ph_t **
dpusm_provider_get(dpusm_t *dpusm, const char *name) {
mutex_lock(&dpusm->lock);
mutex_lock_interruptible(&dpusm->lock);
dpusm_ph_t **provider = find_provider(dpusm, name);
if (provider) {
struct module *module = (*provider)->module;
Expand Down Expand Up @@ -405,7 +405,7 @@ dpusm_provider_put(dpusm_t *dpusm, void *handle) {
}

void dpusm_provider_invalidate(dpusm_t *dpusm, const char *name) {
mutex_lock(&dpusm->lock);;
mutex_lock_interruptible(&dpusm->lock);;
dpusm_ph_t **provider = find_provider(dpusm, name);
if (provider && *provider) {
(*provider)->funcs = NULL;
Expand Down

0 comments on commit 9b8600d

Please sign in to comment.