*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_SERVER_THREAD_H
struct list mutex_list; /* list of currently owned mutexes */
struct debug_ctx *debug_ctx; /* debugger context if this thread is a debugger */
struct debug_event *debug_event; /* debug event being sent to debugger */
+ int debug_break; /* debug breakpoint pending? */
struct msg_queue *queue; /* message queue */
struct thread_wait *wait; /* current wait condition if sleeping */
struct list system_apc; /* queue of system async procedure calls */
int exit_code; /* thread exit code */
int unix_pid; /* Unix pid of client */
int unix_tid; /* Unix tid of client */
- CONTEXT *context; /* current context if in an exception handler */
- CONTEXT *suspend_context; /* current context if suspended */
- void *teb; /* TEB address (in client address space) */
+ context_t *context; /* current context if in an exception handler */
+ context_t *suspend_context; /* current context if suspended */
+ client_ptr_t teb; /* TEB address (in client address space) */
+ affinity_t affinity; /* affinity mask */
int priority; /* priority level */
- int affinity; /* affinity mask */
int suspend; /* suspend count */
obj_handle_t desktop; /* desktop handle */
int desktop_users; /* number of objects using the thread desktop */
- time_t creation_time; /* Thread creation time */
- time_t exit_time; /* Thread exit time */
+ timeout_t creation_time; /* Thread creation time */
+ timeout_t exit_time; /* Thread exit time */
struct token *token; /* security token associated with this thread */
};
extern struct thread *create_thread( int fd, struct process *process );
extern struct thread *get_thread_from_id( thread_id_t id );
extern struct thread *get_thread_from_handle( obj_handle_t handle, unsigned int access );
+extern struct thread *get_thread_from_tid( int tid );
extern struct thread *get_thread_from_pid( int pid );
extern void stop_thread( struct thread *thread );
+extern void stop_thread_if_suspended( struct thread *thread );
extern int wake_thread( struct thread *thread );
extern int add_queue( struct object *obj, struct wait_queue_entry *entry );
extern void remove_queue( struct object *obj, struct wait_queue_entry *entry );
extern void kill_thread( struct thread *thread, int violent_death );
+extern void break_thread( struct thread *thread );
extern void wake_up( struct object *obj, int max );
-extern int thread_queue_apc( struct thread *thread, struct object *owner, void *func,
- enum apc_type type, int system, void *arg1, void *arg2, void *arg3 );
-extern void thread_cancel_apc( struct thread *thread, struct object *owner, int system );
+extern int thread_queue_apc( struct thread *thread, struct object *owner, const apc_call_t *call_data );
+extern void thread_cancel_apc( struct thread *thread, struct object *owner, enum apc_type type );
extern int thread_add_inflight_fd( struct thread *thread, int client, int server );
extern int thread_get_inflight_fd( struct thread *thread, int client );
extern struct thread_snapshot *thread_snap( int *count );
extern struct token *thread_get_impersonation_token( struct thread *thread );
+extern int set_thread_affinity( struct thread *thread, affinity_t affinity );
/* ptrace functions */
extern void sigchld_callback(void);
-extern int get_ptrace_pid( struct thread *thread );
-extern int suspend_for_ptrace( struct thread *thread );
-extern void resume_after_ptrace( struct thread *thread );
-extern void *get_thread_ip( struct thread *thread );
-extern void get_thread_context( struct thread *thread, CONTEXT *context, unsigned int flags );
-extern void set_thread_context( struct thread *thread, const CONTEXT *context, unsigned int flags );
-extern int tkill( int tgid, int pid, int sig );
+extern void get_thread_context( struct thread *thread, context_t *context, unsigned int flags );
+extern void set_thread_context( struct thread *thread, const context_t *context, unsigned int flags );
extern int send_thread_signal( struct thread *thread, int sig );
extern void get_selector_entry( struct thread *thread, int entry, unsigned int *base,
unsigned int *limit, unsigned char *flags );