Displaying 3 results from an estimated 3 matches for "test_thread".
Did you mean:
net_thread
2017 Feb 06
2
Real time threads don't work in libvirt containers under CentOS 7.3
...7.3 that breaks real time threads in
libvirt containers?
This is the simple test program I created to verify the real time
threads are failing. This same program works in a libvirt container in
CentOS 7.2.
#include <stdio.h>
#include <string.h>
#include <pthread.h>
pthread_t test_thread;
void *test(void *arg)
{
printf("Starting thread\n");
sleep(1);
printf("Thread complete\n");
return 0;
}
int main(int argc, char *argv[])
{
int rc;
printf("Starting main\n");
struct sched_param tsparam;
pthread_attr_t tattr;...
2016 Apr 04
0
[PATCH 2/2] Use 'error' function for fprintf followed by exit.
...EXIT_FAILURE);
- }
+ if (g == NULL)
+ error (EXIT_FAILURE, errno, "guestfs_create");
if (guestfs_add_drive_scratch (g, filesize, -1) == -1)
exit (EXIT_FAILURE);
@@ -115,10 +113,8 @@ main (int argc, char *argv[])
/* Create the test thread. */
r = pthread_create (&test_thread, NULL, start_test_thread, &data);
- if (r != 0) {
- fprintf (stderr, "pthread_create: %s\n", strerror (r));
- exit (EXIT_FAILURE);
- }
+ if (r != 0)
+ error (EXIT_FAILURE, r, "pthread_create");
/* Do the upload. */
op_error = guestfs_upload (g, dev_fd, &q...
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...XEC) == -1) {
- perror ("fcntl");
- exit (EXIT_FAILURE);
- }
+ fcntl (fds[1], F_SETFD, FD_CLOEXEC) == -1)
+ error (EXIT_FAILURE, errno, "fcntl");
data.fd = fds[0];
snprintf (dev_fd, sizeof dev_fd, "/dev/fd/%d", fds[1]);
@@ -241,10 +234,9 @@ start_test_thread (void *datav)
n = MIN (sizeof buffer,
(size_t) (data->cancel_posn - data->transfer_size));
r = write (data->fd, buffer, n);
- if (r == -1) {
- perror ("test thread: write to pipe before user cancel");
- exit (EXIT_FAILURE);
-...