At any rate, pause will work, I've seen people do:
And then, as mentioned, pthread_kill can wake it provided the thread hasn't blocked the signal.
Interesting. That'll take some careful use of signals though, whether a system call returns with SIGINT when interrupted is optional, and not all systems have the same default.
Quote:
Originally Posted by DreamWarrior
sleep doesn't send SIGALRM.
Maybe not on your system, but some sure do.
Last edited by Corona688; 12-16-2011 at 05:38 PM..
Im old to Unix but new to scripting
I have a MacBook running osx that I want to use as an nfs client. The server will be a linux box with a wake on lan card. Here's the idea. Run a cron command on the mac every minute that checks if I am on my home wireless network (the linux box is wired to... (0 Replies)
m old to Unix but new to scripting
I have a MacBook running osx that I want to use as an nfs client. The server will be a linux box with a wake on lan card. Here's the idea. Run a cron command on the mac every minute that checks if I am on my home wireless network (the linux box is wired to... (6 Replies)
I have two threads: one maintains a thread-safe message queue (handle this queue at the beginning of every loop) and deals with tcp connections, the other one posts message to the former one. the problem is, while the former one was blocking at epoll_wait, it's not sure that how long until the... (0 Replies)
Hello, I'm searching for a proper way to let the kernel space ISR(implemented in a kernel module) wake up a user space thread on a hardware interrupt.
Except for sending a real-time signal, is it possible to use a semaphore?
I've searched it on google, but it seems impossible to share a... (0 Replies)
This is a very crude attempt in Bash at something that I needed but didn't seem to find in the 'sleep' command. However, I would like to be able to do it without the need for the temp file. Please go easy on me if this is already possible in some other way:
How many times have you used the... (5 Replies)
Hi all,
Is it possible to do the following in Linux (kernel 2.6.x):
- A user-space thread goes to "sleep". Using any call/mechanism
- On a hardware generated interrupt, the Interrupt handler (ISR) "wakes" the sleeping user-thread.
I have seen wait_event() and wake_up() but it appears... (1 Reply)
I'm a OS X user (MacBook Pro, OS X Lion) and I need it to wake up on Mondays, Wednesdays, Thursdays and Saturdays at 9:00 AM
on the rest of the days of the week at 7:00
I issue the following commands:
sudo pmset repeat wake MWRS 09:00:00 for the former
sudo pmset repeat wake TFU... (1 Reply)
Discussion started by: scrutinizerix
1 Replies
LEARN ABOUT OPENSOLARIS
pthread_kill
pthread_kill(3C) Standard C Library Functions pthread_kill(3C)NAME
pthread_kill - send a signal to a thread
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include <signal.h>
#include <pthread.h>
int pthread_kill(pthread_t thread, int sig);
DESCRIPTION
The pthread_kill() function sends the sig signal to the thread designated by thread. The thread argument must be a member of the same
process as the calling thread. The sig argument must be one of the signals listed in signal.h(3HEAD), with the exception of SIGCANCEL
being reserved and off limits to pthread_kill(). If sig is 0, a validity check is performed for the existence of the target thread; no
signal is sent.
RETURN VALUES
Upon successful completion, the function returns a value of 0. Otherwise the function returns an error number. If the pthread_kill() func-
tion fails, no signal is sent.
ERRORS
The pthread_kill() function will fail if:
ESRCH No thread could be found corresponding to that specified by the given thread ID.
EINVAL The value of the sig argument is an invalid or unsupported signal number.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO kill(1), pthread_self(3C), pthread_sigmask(3C), raise(3C), attributes(5), standards(5)SunOS 5.11 23 Mar 2005 pthread_kill(3C)