search for: req_queue_len

Displaying 1 result from an estimated 1 matches for "req_queue_len".

2012 Mar 11
2
[patch] Threading support in ssh-agent
...@@ -88,6 +93,9 @@ AUTH_UNUSED, AUTH_SOCKET, AUTH_CONNECTION +#ifdef HAVE_LIBPTHREAD + , AUTH_INUSE +#endif } sock_type; typedef struct { @@ -137,6 +145,50 @@ /* Default lifetime (0 == forever) */ static int lifetime = 0; +#ifdef HAVE_LIBPTHREAD + +#define MAX_THREADS 20 + +#define REQ_QUEUE_LEN (MAX_THREADS * 2) + +typedef void (*AuthWorker)(SocketEntry*); + +struct AuthRequestQueueEntry { + AuthWorker worker; + SocketEntry *e; +}; + +struct AuthRequestQueue { + struct AuthRequestQueueEntry queue[REQ_QUEUE_LEN]; + int first; + int used; + int inprogress; /* operated by get() */ + pthread_...