Changeset d9c2284 for benchmark/io/http/worker.cfa
- Timestamp:
- Jul 20, 2020, 4:32:04 PM (3 years ago)
- Branches:
- ADT, arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 5751a56
- Parents:
- 124c1b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/worker.cfa
r124c1b7 rd9c2284 12 12 #include "filecache.hfa" 13 13 14 extern "C" {15 // extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);16 extern ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags);17 }18 19 ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) {20 return splice(in_fd, offset, out_fd, 0p, count, 0);21 }22 23 24 14 //============================================================================================= 25 15 // Worker Thread … … 27 17 void ?{}( Worker & this ) { 28 18 ((thread&)this){ "Server Worker Thread", *options.clopts.instance }; 29 int ret = pipe(this.pipe);30 if( ret < 0 ) { abort( "pipe error: (%d) %s\n", (int)errno, strerror(errno) ); }19 this.pipe[0] = -1; 20 this.pipe[1] = -1; 31 21 } 32 22 33 23 void main( Worker & this ) { 24 park( __cfaabi_dbg_ctx ); 25 /* paranoid */ assert( this.pipe[0] != -1 ); 26 /* paranoid */ assert( this.pipe[1] != -1 ); 27 34 28 CONNECTION: 35 29 for() {
Note: See TracChangeset
for help on using the changeset viewer.