Skip to content

Commit 8c7def5

Browse files
committed
session server UPDATE no timeout for queue lock
Prefer infinite wait on problems, if the lock is not acquired it most likely means a fatal error anyway.
1 parent ac1786b commit 8c7def5

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/session_p.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,6 @@ struct nc_server_opts {
335335
*/
336336
#define NC_SESSION_FREE_LOCK_TIMEOUT 1000
337337

338-
/**
339-
* Timeout in msec for acquiring a lock of a pollsession structure.
340-
*/
341-
#define NC_PS_LOCK_TIMEOUT 200
342-
343338
/**
344339
* Timeout in msec for a thread to wait for its turn to work with a pollsession structure.
345340
*/

src/session_server.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,10 +1021,8 @@ nc_ps_lock(struct nc_pollsession *ps, uint8_t *id, const char *func)
10211021
int ret;
10221022
struct timespec ts;
10231023

1024-
nc_timeouttime_get(&ts, NC_PS_LOCK_TIMEOUT);
1025-
10261024
/* LOCK */
1027-
ret = pthread_mutex_clocklock(&ps->lock, COMPAT_CLOCK_ID, &ts);
1025+
ret = pthread_mutex_lock(&ps->lock);
10281026
if (ret) {
10291027
ERR(NULL, "%s: failed to lock a pollsession (%s).", func, strerror(ret));
10301028
return -1;
@@ -1075,12 +1073,9 @@ int
10751073
nc_ps_unlock(struct nc_pollsession *ps, uint8_t id, const char *func)
10761074
{
10771075
int ret;
1078-
struct timespec ts;
1079-
1080-
nc_timeouttime_get(&ts, NC_PS_LOCK_TIMEOUT);
10811076

10821077
/* LOCK */
1083-
ret = pthread_mutex_clocklock(&ps->lock, COMPAT_CLOCK_ID, &ts);
1078+
ret = pthread_mutex_lock(&ps->lock);
10841079
if (ret) {
10851080
ERR(NULL, "%s: failed to lock a pollsession (%s).", func, strerror(ret));
10861081
ret = -1;

0 commit comments

Comments
 (0)