-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttpWorkerThread.h
More file actions
24 lines (19 loc) · 854 Bytes
/
httpWorkerThread.h
File metadata and controls
24 lines (19 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include <pthread.h>
#include "channel.h"
#include "string.h"
#include "cache.h"
/**
* Creates an http worker pool. Takes ownership of none of the params. Ownership of created
* inputChannel is passed to caller.
* @param cache The file cache that files are retrieved from.
* @param threads The location to store the ids.
* @param numThreads The number of threads to put in the pool
* @param inputChannel out parameter for a channel to communicate to worker threads. Use
* by sending a pointer to the file descriptor of the socket for an incoming connection.
* The http thread will close the socket and free the location in memory it is stored at once
* finished processing.
*/
void
createHttpWorkerPool(channel_t logger, fileCache_t cache, pthread_t *threads, size_t numThreads,
channel_t *inputChannel);