Overview
| Comment: | Updated to use nanosleep() instead of usleep() which requires a _BSD_SOURCE macro |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
1fb0b13c23efd52a6193166319366882 |
| User & Date: | rkeene on 2016-09-22 18:34:17 |
| Other Links: | manifest | tags |
Context
|
2016-09-22
| ||
| 19:02 | Updated to support compiling filed in alternate directories check-in: 08602df0fc user: rkeene tags: trunk | |
| 18:34 | Updated to use nanosleep() instead of usleep() which requires a _BSD_SOURCE macro check-in: 1fb0b13c23 user: rkeene tags: trunk | |
| 18:01 | Updated to explicitly use sigaction and BSD-style signal handlers, needed to properly deal with SIGPIPE when closing connections check-in: 3a7004a8cd user: rkeene tags: trunk | |
Changes
Modified filed.c from [ca95c3f44a] to [34dea9bf8d].
| ︙ | ︙ | |||
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 |
atomic_store(&filed_sockettimeout_sockstatus[sockfd].valid, false);
return;
}
static void *filed_sockettimeout_thread(void *arg) {
time_t now, expiration_time;
pthread_t thread_id;
long idx;
int count;
bool valid;
while (1) {
for (count = 0; count < 10; count++) {
| > > > | | 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 |
atomic_store(&filed_sockettimeout_sockstatus[sockfd].valid, false);
return;
}
static void *filed_sockettimeout_thread(void *arg) {
struct timespec sleep_time;
time_t now, expiration_time;
pthread_t thread_id;
long idx;
int count;
bool valid;
while (1) {
for (count = 0; count < 10; count++) {
sleep_time.tv_sec = 30;
sleep_time.tv_nsec = 0;
nanosleep(&sleep_time, NULL);
now = time(NULL);
atomic_store(&filed_sockettimeout_time, now);
}
for (idx = 0; idx < filed_sockettimeout_sockstatus_length; idx++) {
|
| ︙ | ︙ | |||
1911 1912 1913 1914 1915 1916 1917 |
return(5);
}
/* Wait for threads to exit */
/* XXX:TODO: Monitor thread usage */
while (1) {
| | | 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 |
return(5);
}
/* Wait for threads to exit */
/* XXX:TODO: Monitor thread usage */
while (1) {
sleep(86400);
}
/* Return in failure */
return(2);
}
|