19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
1 |
/* Gearman server and library
|
2 |
* Copyright (C) 2008 Brian Aker, Eric Day
|
|
3 |
* All rights reserved.
|
|
4 |
*
|
|
5 |
* Use and distribution licensed under the BSD license. See
|
|
6 |
* the COPYING file in the parent directory for full text.
|
|
7 |
*/
|
|
8 |
||
473.1.3
by Brian Aker
Quick pass through the code to break out the structures. |
9 |
#pragma once
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
10 |
|
473.1.3
by Brian Aker
Quick pass through the code to break out the structures. |
11 |
#include <libgearman-server/struct/thread.h> |
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
12 |
|
13 |
#ifdef __cplusplus
|
|
14 |
extern "C" { |
|
15 |
#endif
|
|
16 |
||
365.1.3
by Piotr Sikora
#include <pthread.h> when using pthread types. |
17 |
#include <pthread.h> |
18 |
||
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
19 |
/**
|
211.2.35
by Eric Day
Increased version numbers, cleaned up documentation, minor API tweaks. |
20 |
* @addtogroup gearman_server_thread Thread Declarations
|
21 |
* @ingroup gearman_server
|
|
22 |
*
|
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
23 |
* This is the interface gearman servers should use for creating threads.
|
211.2.35
by Eric Day
Increased version numbers, cleaned up documentation, minor API tweaks. |
24 |
*
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
25 |
* @{
|
26 |
*/
|
|
27 |
||
28 |
/**
|
|
29 |
* Initialize a thread structure. This cannot fail if the caller supplies a
|
|
30 |
* thread structure.
|
|
123
by Eric Day
Man page reworking, OSX bug fixes. |
31 |
* @param server Server structure previously initialized with
|
32 |
* gearman_server_create.
|
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
33 |
* @param thread Caller allocated thread structure, or NULL to allocate one.
|
34 |
* @return Pointer to an allocated thread structure if thread parameter was
|
|
35 |
* NULL, or the thread parameter pointer if it was not NULL.
|
|
36 |
*/
|
|
19.17.1
by Monty Taylor
Added visibility support. |
37 |
GEARMAN_API
|
379
by Brian Aker
Merge in all DD fixes that can be merged with this version. See Changelog for lists of fixes |
38 |
bool gearman_server_thread_init(gearman_server_st *server, |
39 |
gearman_server_thread_st *thread, |
|
40 |
gearman_log_server_fn *function, |
|
41 |
gearmand_thread_st *context, |
|
42 |
gearmand_event_watch_fn *event_watch); |
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
43 |
|
44 |
/**
|
|
45 |
* Free resources used by a thread structure.
|
|
46 |
* @param thread Thread structure previously initialized with
|
|
379
by Brian Aker
Merge in all DD fixes that can be merged with this version. See Changelog for lists of fixes |
47 |
* gearman_server_thread_init.
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
48 |
*/
|
19.17.1
by Monty Taylor
Added visibility support. |
49 |
GEARMAN_API
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
50 |
void gearman_server_thread_free(gearman_server_thread_st *thread); |
51 |
||
52 |
/**
|
|
53 |
* Set thread run callback.
|
|
54 |
* @param thread Thread structure previously initialized with
|
|
379
by Brian Aker
Merge in all DD fixes that can be merged with this version. See Changelog for lists of fixes |
55 |
* gearman_server_thread_init.
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
56 |
* @param run_fn Function to call when thread should be run.
|
57 |
* @param run_arg Argument to pass along with run_fn.
|
|
58 |
*/
|
|
19.17.1
by Monty Taylor
Added visibility support. |
59 |
GEARMAN_API
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
60 |
void gearman_server_thread_set_run(gearman_server_thread_st *thread, |
61 |
gearman_server_thread_run_fn *run_fn, |
|
62 |
void *run_arg); |
|
63 |
||
64 |
/**
|
|
65 |
* Process server thread connections.
|
|
66 |
* @param thread Thread structure previously initialized with
|
|
379
by Brian Aker
Merge in all DD fixes that can be merged with this version. See Changelog for lists of fixes |
67 |
* gearman_server_thread_init.
|
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
68 |
* @param ret_ptr Pointer to hold a standard gearman return value.
|
69 |
* @return On error, the server connection that encountered the error.
|
|
70 |
*/
|
|
19.17.1
by Monty Taylor
Added visibility support. |
71 |
GEARMAN_API
|
379
by Brian Aker
Merge in all DD fixes that can be merged with this version. See Changelog for lists of fixes |
72 |
gearmand_con_st * |
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
73 |
gearman_server_thread_run(gearman_server_thread_st *thread, |
389
by Brian Aker
Adds in a gearadmin so that you don't have to telnet to the port to execute |
74 |
gearmand_error_t *ret_ptr); |
19.6.10
by Eric Day
Much of ther server thread work done, still some bugs. The single threaded version still seems to be stable. |
75 |
|
76 |
/** @} */
|
|
77 |
||
78 |
#ifdef __cplusplus
|
|
79 |
}
|
|
80 |
#endif
|