1 | /* |
1 | /* |
2 | * libev event processing core, watcher management |
2 | * libev event processing core, watcher management |
3 | * |
3 | * |
4 | * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> |
4 | * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev@schmorp.de> |
5 | * All rights reserved. |
5 | * All rights reserved. |
6 | * |
6 | * |
7 | * Redistribution and use in source and binary forms, with or without modifica- |
7 | * Redistribution and use in source and binary forms, with or without modifica- |
8 | * tion, are permitted provided that the following conditions are met: |
8 | * tion, are permitted provided that the following conditions are met: |
9 | * |
9 | * |
… | |
… | |
579 | #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore") |
579 | #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore") |
580 | #elif defined __s390__ || defined __s390x__ |
580 | #elif defined __s390__ || defined __s390x__ |
581 | #define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory") |
581 | #define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory") |
582 | #elif defined __mips__ |
582 | #elif defined __mips__ |
583 | #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory") |
583 | #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory") |
|
|
584 | #elif defined __alpha__ |
|
|
585 | #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mb" : : : "memory") |
584 | #endif |
586 | #endif |
585 | #endif |
587 | #endif |
586 | #endif |
588 | #endif |
587 | |
589 | |
588 | #ifndef ECB_MEMORY_FENCE |
590 | #ifndef ECB_MEMORY_FENCE |
… | |
… | |
2930 | |
2932 | |
2931 | mn_now = ev_rt_now; |
2933 | mn_now = ev_rt_now; |
2932 | } |
2934 | } |
2933 | } |
2935 | } |
2934 | |
2936 | |
2935 | void |
2937 | int |
2936 | ev_run (EV_P_ int flags) |
2938 | ev_run (EV_P_ int flags) |
2937 | { |
2939 | { |
2938 | #if EV_FEATURE_API |
2940 | #if EV_FEATURE_API |
2939 | ++loop_depth; |
2941 | ++loop_depth; |
2940 | #endif |
2942 | #endif |
… | |
… | |
3097 | loop_done = EVBREAK_CANCEL; |
3099 | loop_done = EVBREAK_CANCEL; |
3098 | |
3100 | |
3099 | #if EV_FEATURE_API |
3101 | #if EV_FEATURE_API |
3100 | --loop_depth; |
3102 | --loop_depth; |
3101 | #endif |
3103 | #endif |
|
|
3104 | |
|
|
3105 | return activecnt; |
3102 | } |
3106 | } |
3103 | |
3107 | |
3104 | void |
3108 | void |
3105 | ev_break (EV_P_ int how) |
3109 | ev_break (EV_P_ int how) |
3106 | { |
3110 | { |