Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Mark call to lirc_client.lirc_nextcode(...) as nogil, otherwise calli…
Browse files Browse the repository at this point in the history
…ng it would block all threads in our python program
  • Loading branch information
Jan Peter Stotz committed Feb 19, 2017
1 parent 4091fe9 commit d6470fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lirc/lirc.pyx
Expand Up @@ -222,7 +222,10 @@ def nextcode():
_is_init_or_error()

cdef char * code
if lirc_client.lirc_nextcode(&code) == -1:
cdef int return_value
with nogil:
return_value = lirc_client.lirc_nextcode(&code)
if return_value == -1:
free(code)
raise NextCodeError("There was an error reading the next code.")
if code == NULL:
Expand Down
2 changes: 1 addition & 1 deletion lirc/lirc_client.pxd
Expand Up @@ -12,5 +12,5 @@ cdef extern from "lirc/lirc_client.h":
int lirc_readconfig(char *file, lirc_config **config, void * check_callback)
void lirc_freeconfig(lirc_config *config)

int lirc_nextcode(char **code)
int lirc_nextcode(char **code) nogil
int lirc_code2char(lirc_config *config, char *code, char **string)

0 comments on commit d6470fb

Please sign in to comment.