Skip to content

Commit

Permalink
Fixed typos PyMutex_Lock should get a pointer (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 authored Sep 20, 2024
1 parent fe4dd3b commit 809d176
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/porting.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,15 @@ typedef struct lib_state_struct {
} lib_state_struct;
int call_library_function(lib_state_struct *lib_state) {
PyMutex_Lock(lib_state->lock);
PyMutex_Lock(&lib_state->lock);
library_function(lib_state->state);
PyMutex_Unlock(lib_state->lock)
PyMutex_Unlock(&lib_state->lock)
}
int call_another_library_function(lib_state_struct *lib_state) {
PyMutex_Lock(lib_state->lock);
PyMutex_Lock(&lib_state->lock);
another_library_function(lib_state->state);
PyMutex_Unlock(lib_state->lock)
PyMutex_Unlock(&lib_state->lock)
}
```

Expand All @@ -451,9 +451,9 @@ library. This means that non-reentrant libraries require a global lock:
static PyMutex global_lock = {0};

int call_library_function(int *argument) {
PyMutex_Lock(global_lock);
PyMutex_Lock(&global_lock);
library_function(argument);
PyMutex_Unlock(global_lock);
PyMutex_Unlock(&global_lock);
}
```

Expand Down

0 comments on commit 809d176

Please sign in to comment.