Skip to content

Commit

Permalink
lock: Fix passing the wrong parameter when creating threads on Windows
Browse files Browse the repository at this point in the history
Send the same parameters as the Unix implementation:
https://github.com/analogdevicesinc/libiio/blob/e54973a39f6f35fda3cf170d8585d48d65450e7b/lock.c#L131

This was causing random crashes when running iio_info on Windows. Error
was: "0xC0000005: Access violation executing location".

Signed-off-by: Dan Nechita <[email protected]>
  • Loading branch information
dNechita committed Feb 20, 2025
1 parent e54973a commit 73bba25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lock-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct iio_thrd * iio_thrd_create(int (*thrd)(void *),

iio_thrd->thid = CreateThread(NULL, 0,
(LPTHREAD_START_ROUTINE) iio_thrd_wrapper,
d, 0, NULL);
iio_thrd, 0, NULL);
if (!iio_thrd->thid) {
free(iio_thrd);
return iio_ptr(-(int) GetLastError());
Expand Down

0 comments on commit 73bba25

Please sign in to comment.