mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-27 02:49:42 +00:00
poll() and select() are still not cancellation points in MacOS X 10.4.4...
This commit is contained in:
parent
a6156a17b7
commit
ceb7488a77
@ -20,6 +20,19 @@
|
|||||||
|
|
||||||
#include "sysdeps.h"
|
#include "sysdeps.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTES concerning MacOS X issues:
|
||||||
|
* - poll() does not exist in 10.2.8, but is available in 10.4.4
|
||||||
|
* - select(), and very likely poll(), are not cancellation points. So
|
||||||
|
* the ethernet thread doesn't stop on exit. An explicit check is
|
||||||
|
* performed to workaround this problem.
|
||||||
|
*/
|
||||||
|
#if (defined __APPLE__ && defined __MACH__) || ! defined HAVE_POLL
|
||||||
|
#define USE_POLL 0
|
||||||
|
#else
|
||||||
|
#define USE_POLL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_POLL_H
|
#ifdef HAVE_SYS_POLL_H
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
#endif
|
#endif
|
||||||
@ -815,7 +828,7 @@ static void *receive_func(void *arg)
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
||||||
// Wait for packets to arrive
|
// Wait for packets to arrive
|
||||||
#if HAVE_POLL
|
#if USE_POLL
|
||||||
struct pollfd pf = {fd, POLLIN, 0};
|
struct pollfd pf = {fd, POLLIN, 0};
|
||||||
int res = poll(&pf, 1, -1);
|
int res = poll(&pf, 1, -1);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user