-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap render function in SWIG threads macro, to disable Python GIL
- Loading branch information
1 parent
95a43d6
commit 8738451
Showing
4 changed files
with
77 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
// SWIG interface file to define rpi_ws281x library python wrapper. | ||
// Author: Tony DiCola ([email protected]), Jeremy Garff ([email protected]) | ||
|
||
%nothread; | ||
|
||
// Define module name rpi_ws281x. This will actually be imported under | ||
// the name _rpi_ws281x following the SWIG & Python conventions. | ||
%module rpi_ws281x | ||
|
@@ -92,3 +94,12 @@ static int convert_iarray(PyObject *input, uint8_t *ptr, int size) { | |
return &ws->channel[channelnum]; | ||
} | ||
%} | ||
|
||
%thread; | ||
%inline %{ | ||
ws2811_return_t ws2811_render_nogil(ws2811_t *ws2811) | ||
{ | ||
return ws2811_render(ws2811); | ||
} | ||
%} | ||
%nothread; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters