diff options
| author | YAMAMOTO Mitsuharu | 2008-04-06 01:57:37 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2008-04-06 01:57:37 +0000 |
| commit | cc69f23aedadf9cc6463cc47b431910694467a99 (patch) | |
| tree | 2c47440001e45453e20f201fd05b891706a93721 /src/mac.c | |
| parent | f4f1eb1002f4d49d64cf2452d55b120a71526dc7 (diff) | |
| download | emacs-cc69f23aedadf9cc6463cc47b431910694467a99.tar.gz emacs-cc69f23aedadf9cc6463cc47b431910694467a99.zip | |
[MAC_OSX] (select_and_poll_event, sys_select):
Use mac_run_loop_run_once instead of CFRunLoopRunInMode.
Diffstat (limited to 'src/mac.c')
| -rw-r--r-- | src/mac.c | 26 |
1 files changed, 6 insertions, 20 deletions
| @@ -4989,8 +4989,8 @@ extern int noninteractive; | |||
| 4989 | SELECT_TIMEOUT_THRESHOLD_RUNLOOP seconds). | 4989 | SELECT_TIMEOUT_THRESHOLD_RUNLOOP seconds). |
| 4990 | -> Create CFSocket for each socket and add it into the current | 4990 | -> Create CFSocket for each socket and add it into the current |
| 4991 | event RunLoop so that the current event loop gets quit when | 4991 | event RunLoop so that the current event loop gets quit when |
| 4992 | the socket becomes ready. Then CFRunLoopRunInMode can wait | 4992 | the socket becomes ready. Then mac_run_loop_run_once can |
| 4993 | for both kinds of inputs. | 4993 | wait for both kinds of inputs. |
| 4994 | 4. Otherwise. | 4994 | 4. Otherwise. |
| 4995 | -> Periodically poll the window input channel while repeatedly | 4995 | -> Periodically poll the window input channel while repeatedly |
| 4996 | executing `select' with a short timeout | 4996 | executing `select' with a short timeout |
| @@ -5045,7 +5045,7 @@ select_and_poll_event (nfds, rfds, wfds, efds, timeout) | |||
| 5045 | if (efds) oefds = *efds; | 5045 | if (efds) oefds = *efds; |
| 5046 | } | 5046 | } |
| 5047 | 5047 | ||
| 5048 | /* Try detect_input_pending before CFRunLoopRunInMode in the same | 5048 | /* Try detect_input_pending before mac_run_loop_run_once in the same |
| 5049 | BLOCK_INPUT block, in case that some input has already been read | 5049 | BLOCK_INPUT block, in case that some input has already been read |
| 5050 | asynchronously. */ | 5050 | asynchronously. */ |
| 5051 | BLOCK_INPUT; | 5051 | BLOCK_INPUT; |
| @@ -5062,15 +5062,7 @@ select_and_poll_event (nfds, rfds, wfds, efds, timeout) | |||
| 5062 | if (timeoutval == 0.0) | 5062 | if (timeoutval == 0.0) |
| 5063 | timedout_p = 1; | 5063 | timedout_p = 1; |
| 5064 | else | 5064 | else |
| 5065 | { | 5065 | timedout_p = mac_run_loop_run_once (timeoutval); |
| 5066 | #if USE_CG_DRAWING | ||
| 5067 | mac_prepare_for_quickdraw (NULL); | ||
| 5068 | #endif | ||
| 5069 | if (CFRunLoopRunInMode (kCFRunLoopDefaultMode, | ||
| 5070 | timeoutval >= 0 ? timeoutval : 100000, true) | ||
| 5071 | == kCFRunLoopRunTimedOut) | ||
| 5072 | timedout_p = 1; | ||
| 5073 | } | ||
| 5074 | 5066 | ||
| 5075 | if (timeout == NULL && timedout_p) | 5067 | if (timeout == NULL && timedout_p) |
| 5076 | { | 5068 | { |
| @@ -5193,7 +5185,7 @@ sys_select (nfds, rfds, wfds, efds, timeout) | |||
| 5193 | if (timeoutval > 0 && timeoutval <= SELECT_TIMEOUT_THRESHOLD_RUNLOOP) | 5185 | if (timeoutval > 0 && timeoutval <= SELECT_TIMEOUT_THRESHOLD_RUNLOOP) |
| 5194 | goto poll_periodically; | 5186 | goto poll_periodically; |
| 5195 | 5187 | ||
| 5196 | /* Try detect_input_pending before CFRunLoopRunInMode in the | 5188 | /* Try detect_input_pending before mac_run_loop_run_once in the |
| 5197 | same BLOCK_INPUT block, in case that some input has already | 5189 | same BLOCK_INPUT block, in case that some input has already |
| 5198 | been read asynchronously. */ | 5190 | been read asynchronously. */ |
| 5199 | BLOCK_INPUT; | 5191 | BLOCK_INPUT; |
| @@ -5246,13 +5238,7 @@ sys_select (nfds, rfds, wfds, efds, timeout) | |||
| 5246 | CFRunLoopAddSource (runloop, source, kCFRunLoopDefaultMode); | 5238 | CFRunLoopAddSource (runloop, source, kCFRunLoopDefaultMode); |
| 5247 | } | 5239 | } |
| 5248 | 5240 | ||
| 5249 | #if USE_CG_DRAWING | 5241 | timedout_p = mac_run_loop_run_once (timeoutval); |
| 5250 | mac_prepare_for_quickdraw (NULL); | ||
| 5251 | #endif | ||
| 5252 | if (CFRunLoopRunInMode (kCFRunLoopDefaultMode, | ||
| 5253 | timeoutval >= 0 ? timeoutval : 100000, true) | ||
| 5254 | == kCFRunLoopRunTimedOut) | ||
| 5255 | timedout_p = 1; | ||
| 5256 | 5242 | ||
| 5257 | for (fd = minfd; fd < nfds; fd++) | 5243 | for (fd = minfd; fd < nfds; fd++) |
| 5258 | if (FD_ISSET (fd, rfds) || (wfds && FD_ISSET (fd, wfds))) | 5244 | if (FD_ISSET (fd, rfds) || (wfds && FD_ISSET (fd, wfds))) |