Changeset 4790fc84757a210ff4aed6895cac2729f4a3e497
- Timestamp:
- 10/26/09 13:54:16
(4 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1256565256 +0000
- git-parent:
[32caf513db21174aadcdb215e526729da411a265]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1256565256 +0000
- Message:
Cleanup and make sure Solaris Sun Studio compilers get -mt and POSIX thread semantics or things will go very wrong, refs #34
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2ea7724 |
r4790fc8 |
|
| 54 | 54 | AC_MSG_RESULT([32]) |
|---|
| 55 | 55 | ATOMIC_OBJS="noit_atomic_sol_x86_32.o" |
|---|
| | 56 | fi |
|---|
| | 57 | if test "x$CC" != "xgcc" ; then |
|---|
| | 58 | CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -mt" |
|---|
| 56 | 59 | fi |
|---|
| 57 | 60 | PICFLAGS="-Kpic" |
|---|
| r6523dbe |
r4790fc8 |
|
| 32 | 32 | NOWHOLE_ARCHIVE=@NOWHOLE_ARCHIVE@ |
|---|
| 33 | 33 | |
|---|
| 34 | | SUBS=lua utils eventer udns modules noitedit man stomp |
|---|
| | 34 | SUBS=lua utils eventer udns noitedit man stomp |
|---|
| | 35 | MODDIR=modules |
|---|
| 35 | 36 | |
|---|
| 36 | 37 | NOIT_OBJS=noitd.o noit_listener.o \ |
|---|
| … | … | |
| 60 | 61 | done |
|---|
| 61 | 62 | |
|---|
| | 63 | make-modules: |
|---|
| | 64 | @for dir in $(MODDIR) ; do \ |
|---|
| | 65 | echo "- building $$dir bits" ; \ |
|---|
| | 66 | (cd $$dir && make -s) ; \ |
|---|
| | 67 | done |
|---|
| | 68 | |
|---|
| 62 | 69 | java-bits: |
|---|
| 63 | 70 | @echo "- building java bits" |
|---|
| … | … | |
| 67 | 74 | @(cd jlog && make libjlog.a) |
|---|
| 68 | 75 | |
|---|
| 69 | | noitd: make-subdirs $(NOIT_OBJS) |
|---|
| | 76 | noitd: make-subdirs make-modules $(NOIT_OBJS) |
|---|
| 70 | 77 | @$(CC) -o $@ $(NOIT_OBJS) \ |
|---|
| 71 | 78 | udns/libudns.o \ |
|---|
| r6688159 |
r4790fc8 |
|
| 168 | 168 | } |
|---|
| 169 | 169 | goto cleanup_shutdown; |
|---|
| 170 | | |
|---|
| 171 | | return 0; |
|---|
| 172 | 170 | } |
|---|
| r8ad126b |
r4790fc8 |
|
| 130 | 130 | |
|---|
| 131 | 131 | #define EXPOSE_CHECKER(name) \ |
|---|
| 132 | | API_EXPORT(pcre *) noit_conf_get_valid_##name##_checker(); |
|---|
| | 132 | API_EXPORT(pcre *) noit_conf_get_valid_##name##_checker() |
|---|
| 133 | 133 | #define DECLARE_CHECKER(name) \ |
|---|
| 134 | 134 | static pcre *checker_valid_##name; \ |
|---|
| r652d766 |
r4790fc8 |
|
| 54 | 54 | struct bchain *bchain_alloc(size_t size) { |
|---|
| 55 | 55 | struct bchain *n; |
|---|
| 56 | | n = malloc(size + ((void *)n->buff - (void *)n)); |
|---|
| | 56 | n = malloc(size + ((char *)n->buff - (char *)n)); |
|---|
| 57 | 57 | if(!n) return NULL; |
|---|
| 58 | 58 | n->prev = n->next = NULL; |
|---|
| … | … | |
| 462 | 462 | if(rv == noit_true) return mask | EVENTER_WRITE | EVENTER_EXCEPTION; |
|---|
| 463 | 463 | } |
|---|
| 464 | | return EVENTER_READ | EVENTER_EXCEPTION; |
|---|
| | 464 | /* Not reached: |
|---|
| | 465 | * return EVENTER_READ | EVENTER_EXCEPTION; |
|---|
| | 466 | */ |
|---|
| 465 | 467 | } |
|---|
| 466 | 468 | noit_boolean |
|---|
| … | … | |
| 522 | 524 | while(in && bytes_read < len) { |
|---|
| 523 | 525 | int partial_len = MIN(in->size, len - bytes_read); |
|---|
| 524 | | if(buf) memcpy(buf+bytes_read, in->buff+in->start, partial_len); |
|---|
| | 526 | if(buf) memcpy((char *)buf+bytes_read, in->buff+in->start, partial_len); |
|---|
| 525 | 527 | bytes_read += partial_len; |
|---|
| 526 | 528 | ctx->req.content_length_read += partial_len; |
|---|
| … | … | |
| 636 | 638 | ctx->conn.e = NULL; |
|---|
| 637 | 639 | goto release; |
|---|
| 638 | | return 0; |
|---|
| 639 | 640 | } |
|---|
| 640 | 641 | if(ctx->res.complete == noit_true) { |
|---|
| r30843e7 |
r4790fc8 |
|
| 1429 | 1429 | nnode->dispatch = f; |
|---|
| 1430 | 1430 | nnode->next = onlookers; |
|---|
| 1431 | | while(noit_atomic_casptr((void **)&onlookers, nnode, nnode->next) != (void *)nnode->next) |
|---|
| | 1431 | while(noit_atomic_casptr((volatile void **)&onlookers, nnode, nnode->next) != (void *)nnode->next) |
|---|
| 1432 | 1432 | nnode->next = onlookers; |
|---|
| 1433 | 1433 | } |
|---|
| re85722c |
r4790fc8 |
|
| 137 | 137 | extern noit_atomic64_t noit_atomic_cas64(volatile noit_atomic64_t *mem, |
|---|
| 138 | 138 | volatile noit_atomic64_t newval, volatile noit_atomic64_t cmpval); |
|---|
| | 139 | extern void *noit_atomic_casptr(volatile void **mem, |
|---|
| | 140 | volatile void *newval, volatile void *cmpval); |
|---|
| 139 | 141 | |
|---|
| 140 | 142 | static inline void noit_spinlock_lock(volatile noit_spinlock_t *lock) { |
|---|
| r5b63423 |
r4790fc8 |
|
| 74 | 74 | } |
|---|
| 75 | 75 | int noit_watchdog_prefork_init() { |
|---|
| 76 | | lifeline = mmap(NULL, sizeof(int), PROT_READ|PROT_WRITE, |
|---|
| 77 | | MAP_SHARED|MAP_ANON, -1, 0); |
|---|
| | 76 | lifeline = (int *)mmap(NULL, sizeof(int), PROT_READ|PROT_WRITE, |
|---|
| | 77 | MAP_SHARED|MAP_ANON, -1, 0); |
|---|
| 78 | 78 | if(lifeline == (void *)-1) { |
|---|
| 79 | 79 | noitL(noit_error, "Failed to mmap anon for watchdog\n"); |
|---|