Changeset d48b174 for libcfa/src/concurrency/io
- Timestamp:
- Jan 12, 2021, 12:57:59 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 35285fd
- Parents:
- 58f99b3
- Location:
- libcfa/src/concurrency/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io/setup.cfa
r58f99b3 rd48b174 190 190 __cfaabi_tls.this_stats = io_ctx->self.curr_cluster->stats; 191 191 #endif 192 193 eventfd_t v; 194 eventfd_read(io_ctx->ring->efd, &v); 195 192 196 post( io_ctx->sem ); 193 197 } … … 494 498 // I/O Context Sleep 495 499 //============================================================================================= 496 497 void __ioctx_register($io_ctx_thread & ctx, struct epoll_event & ev) { 498 ev.events = EPOLLIN | EPOLLET | EPOLLONESHOT; 500 #define IOEVENTS EPOLLIN | EPOLLONESHOT 501 502 static inline void __ioctx_epoll_ctl($io_ctx_thread & ctx, int op, const char * error) { 503 struct epoll_event ev; 504 ev.events = IOEVENTS; 499 505 ev.data.u64 = (__u64)&ctx; 500 int ret = epoll_ctl(iopoll.epollfd, EPOLL_CTL_ADD, ctx.ring->efd, &ev);506 int ret = epoll_ctl(iopoll.epollfd, op, ctx.ring->efd, &ev); 501 507 if (ret < 0) { 502 abort( "KERNEL ERROR: EPOLL ADD - (%d) %s\n", (int)errno, strerror(errno) ); 503 } 504 } 505 506 void __ioctx_prepare_block($io_ctx_thread & ctx, struct epoll_event & ev) { 508 abort( "KERNEL ERROR: EPOLL %s - (%d) %s\n", error, (int)errno, strerror(errno) ); 509 } 510 } 511 512 void __ioctx_register($io_ctx_thread & ctx) { 513 __ioctx_epoll_ctl(ctx, EPOLL_CTL_ADD, "ADD"); 514 } 515 516 void __ioctx_prepare_block($io_ctx_thread & ctx) { 507 517 __cfadbg_print_safe(io_core, "Kernel I/O - epoll : Re-arming io poller %d (%p)\n", ctx.ring->fd, &ctx); 508 int ret = epoll_ctl(iopoll.epollfd, EPOLL_CTL_MOD, ctx.ring->efd, &ev); 509 if (ret < 0) { 510 abort( "KERNEL ERROR: EPOLL REARM - (%d) %s\n", (int)errno, strerror(errno) ); 511 } 518 __ioctx_epoll_ctl(ctx, EPOLL_CTL_MOD, "REARM"); 512 519 } 513 520 -
libcfa/src/concurrency/io/types.hfa
r58f99b3 rd48b174 131 131 #endif 132 132 133 struct epoll_event;134 133 struct $io_ctx_thread; 135 void __ioctx_register($io_ctx_thread & ctx , struct epoll_event & ev);136 void __ioctx_prepare_block($io_ctx_thread & ctx , struct epoll_event & ev);134 void __ioctx_register($io_ctx_thread & ctx); 135 void __ioctx_prepare_block($io_ctx_thread & ctx); 137 136 #endif 138 137
Note:
See TracChangeset
for help on using the changeset viewer.