search for: pthread_mutex_destroy

Displaying 20 results from an estimated 61 matches for "pthread_mutex_destroy".

2018 Apr 12
3
[PATCH nbdkit 0/2] connections: Protect open and close callbacks with the request lock.
I'm fairly sure that these bugs which appear in the Python plugin: https://bugzilla.redhat.com/show_bug.cgi?id=1566516 https://bugzilla.redhat.com/show_bug.cgi?id=1566522 are really bugs in the SERIALIZE_ALL_REQUESTS thread model. See the first patch for the full explanation. The second patch is a fix for a race condition which is probably nudged into being by the first patch. Now this
2018 Nov 08
1
[nbdkit PATCH] nbd: Fix race during close
...5,9 +575,9 @@ nbd_close (void *handle) nbd_request_raw (h, 0, NBD_CMD_DISC, 0, 0, 0, NULL); shutdown (h->fd, SHUT_WR); } - close (h->fd); if ((errno = pthread_join (h->reader, NULL))) nbdkit_debug ("failed to join reader thread: %m"); + close (h->fd); pthread_mutex_destroy (&h->write_lock); pthread_mutex_destroy (&h->trans_lock); free (h); -- 2.17.2
2017 Nov 17
0
[nbdkit PATCH 3/6] connections: Add read/write lock over client I/O
...t (&conn->request_lock, NULL); + pthread_mutex_init (&conn->read_lock, NULL); + pthread_mutex_init (&conn->write_lock, NULL); conn->recv = raw_recv; conn->send = raw_send; @@ -223,6 +227,8 @@ free_connection (struct connection *conn) conn->close (conn); pthread_mutex_destroy (&conn->request_lock); + pthread_mutex_destroy (&conn->read_lock); + pthread_mutex_destroy (&conn->write_lock); /* Don't call the plugin again if quit has been set because the main * thread will be in the process of unloading it. The plugin.unload @@ -888,19 +894...
2017 Nov 17
8
[RFC nbdkit PATCH 0/6] Enable full parallel request handling
I want to make my nbd forwarding plugin fully parallel - but to do that, I first need to make nbdkit itself fully parallel ;) With this series, I was finally able to demonstrate out-of-order responses when using qemu-io (which is great at sending back-to-back requests prior to waiting for responses) coupled with the nbd file plugin (which has a great feature of rdelay and wdelay, to make it
2017 Nov 21
6
[nbdkit PATCH v2 0/4] enable parallel nbd forwarding
With this, I am finally able to get the nbd plugin to do out-of-order responses to the client. Once this series goes in, we should be ready for Rich to cut a release. Eric Blake (4): nbd: Split reading into separate thread nbd: Protect writes with mutex nbd: Enable parallel handling tests: Test parallel nbd behavior plugins/nbd/nbd.c | 217
2017 Nov 17
2
Re: [nbdkit PATCH 3/6] connections: Add read/write lock over client I/O
...pthread_mutex_init (&conn->read_lock, NULL); > + pthread_mutex_init (&conn->write_lock, NULL); > > conn->recv = raw_recv; > conn->send = raw_send; > @@ -223,6 +227,8 @@ free_connection (struct connection *conn) > conn->close (conn); > > pthread_mutex_destroy (&conn->request_lock); > + pthread_mutex_destroy (&conn->read_lock); > + pthread_mutex_destroy (&conn->write_lock); > > /* Don't call the plugin again if quit has been set because the main > * thread will be in the process of unloading it. The plug...
2019 Jun 18
0
[nbdkit PATCH] Experiment: nbd: Use ppoll() instead of pipe-to-self
...e transaction mutex: %m"); goto err; } + if (sigemptyset (&blocked) == -1 || + sigaddset (&blocked, SIGUSR1) == -1) + assert (false); + if ((errno = pthread_sigmask (SIG_BLOCK, &blocked, NULL))) { + nbdkit_error ("failed to set signal mask: %m"); + pthread_mutex_destroy (&h->trans_lock); + goto err; + } if ((errno = pthread_create (&h->reader, NULL, nbdplug_reader, h))) { nbdkit_error ("failed to initialize reader thread: %m"); pthread_mutex_destroy (&h->trans_lock); goto err; } + if (pthread_sigmask (SIG_SE...
2018 Feb 28
0
[PATCH] lib: Don't abort if a signal handler calls exit(2) during a guestfs_* function.
...d during a guestfs_* call, which will + * cause the close_handles atexit handler to run, calling us here + * with ignore_recursive == 1. + */ + r = glthread_recursive_lock_destroy (&g->lock); + if (r != 0) { + if (r == EBUSY && ignore_recursive) + return; + + /* If pthread_mutex_destroy returns 16 (EBUSY), this indicates + * that the lock is held somewhere. That means a programming + * error if the main program is using threads. + */ + errno = r; + perror ("guestfs_close: g->lock"); + /* While we're debugging locks in libguestfs I want this t...
2009 Mar 18
3
[LLVMdev] Status of LLVM's atomic intrinsics
...ads[t], &attr, inc_count, (void *)t); /* Wait for all threads to complete */ for (i=0; i<NUM_THREADS; i++) { pthread_join(threads[i], NULL); } printf ("Main(): Waited on %d threads. Done.\n", NUM_THREADS); /* Clean up and exit */ pthread_attr_destroy(&attr); pthread_mutex_destroy(&count_mutex); pthread_cond_destroy(&count_threshold_cv); pthread_exit(NULL); } -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e
2017 Dec 02
2
[PATCH nbdkit nbd] nbd: Unsuccessful attempt to fix memory leak.
Hi Eric, There's a memory leak in the nbd client. The message (below) is not very useful because somehow debuginfo is missing in the plugin. However it's easily reproducible by doing: make check-valgrind TESTS=test-nbd I tried the attached patch to fix what I thought was the bug, but sadly the fix doesn't work for me :-( So I guess something else is going on, but it does look as
2017 Nov 14
0
[nbdkit PATCH v2 2/2] nbd: Split reading into separate thread
...read */ + if ((errno = pthread_mutex_init (&h->lock, NULL))) { + nbdkit_error ("failed to initialize mutex"); + goto err; + } + if ((errno = pthread_create (&h->reader, NULL, nbd_reader, h))) { + nbdkit_error ("failed to initialize reader thread"); + pthread_mutex_destroy (&h->lock); + goto err; + } + return h; err: @@ -412,6 +492,9 @@ nbd_close (void *handle) if (!h->dead) nbd_request_raw (h, NBD_CMD_DISC, 0, 0, 0); close (h->fd); + if ((errno = pthread_join (h->reader, NULL))) + nbdkit_debug ("failed to join reader thr...
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...d_mutex_init (&h->trans_lock, NULL))) { - nbdkit_error ("failed to initialize transaction mutex: %m"); - goto err; - } if ((errno = pthread_create (&h->reader, NULL, nbdplug_reader, h))) { nbdkit_error ("failed to initialize reader thread: %m"); - pthread_mutex_destroy (&h->trans_lock); goto err; } @@ -562,7 +518,6 @@ nbdplug_close_handle (struct handle *h) close (h->fds[0]); close (h->fds[1]); nbd_close (h->nbd); - pthread_mutex_destroy (&h->trans_lock); free (h); } @@ -717,7 +672,8 @@ nbdplug_pread (void *handle, v...
2014 Mar 13
2
[PATCH] nouveau: safen up nouveau_device list usage against concurrent access
...mutex_init(&nvdev->lock, NULL); + if (ret) { + free(nvdev); + return ret; + } + nvdev->base.fd = fd; ver = drmGetVersion(fd); @@ -161,6 +167,7 @@ nouveau_device_del(struct nouveau_device **pdev) if (nvdev->close) drmClose(nvdev->base.fd); free(nvdev->client); + pthread_mutex_destroy(&nvdev->lock); free(nvdev); *pdev = NULL; } @@ -191,6 +198,8 @@ nouveau_client_new(struct nouveau_device *dev, struct nouveau_client **pclient) int id = 0, i, ret = -ENOMEM; uint32_t *clients; + pthread_mutex_lock(&nvdev->lock); + for (i = 0; i < nvdev->nr_client...
2017 Nov 20
10
[nbdkit PATCH v2 0/8] Support parallel transactions within single connection
I've posted some of these patches or ideas before; but now I'm confident enough with the series that it should be ready to push; at any rate, I can now run test-socket-activation in a tight loop without triggering any crashes or hangs. With this in place, I'm going back to work on making the nbd forwarder wort with the parallel thread model. Eric Blake (8): sockets: Use
2020 Aug 06
5
[PATCH nbdkit NOT WORKING 0/2] vddk: Relax threading model.
I believe this roughly implements Nir's proposal here: https://www.redhat.com/archives/libguestfs/2020-August/msg00028.html Unfortunately it doesn't work for me. It actually slows things down quite a lot, for reasons I don't understand. Note the adjustment of the pool-max parameter and how it affects the total time. The results are quite reproducible. $ ./nbdkit -r -U - vddk
2020 Aug 06
0
[PATCH nbdkit 2/2] vddk: Relax thread model to PARALLEL and implement a disk handle pool.
...FERED; return h; - err2: - DEBUG_CALL ("VixDiskLib_Disconnect", "connection"); - VixDiskLib_Disconnect (h->connection); err1: free_connect_params (h->params); err0: + free (h->vddk_handles.ptr); + pthread_cond_destroy (&h->vddk_handles_cond); + pthread_mutex_destroy (&h->vddk_handles_lock); free (h); return NULL; } +/* Get a VDDK handle on demand. */ +static VixDiskLibHandle +open_vddk_handle (struct handle *h) +{ + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&open_close_lock); + VixDiskLibHandle vddk_handle; + VixError err; + + DEBUG_CALL ("V...
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...rrno = pthread_mutex_init (&h->write_lock, NULL))) { - nbdkit_error ("failed to initialize write mutex: %m"); - goto err; - } if ((errno = pthread_mutex_init (&h->trans_lock, NULL))) { nbdkit_error ("failed to initialize transaction mutex: %m"); - pthread_mutex_destroy (&h->write_lock); goto err; } if ((errno = pthread_create (&h->reader, NULL, nbdplug_reader, h))) { nbdkit_error ("failed to initialize reader thread: %m"); - pthread_mutex_destroy (&h->write_lock); pthread_mutex_destroy (&h->trans_lock)...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...rrno = pthread_mutex_init (&h->write_lock, NULL))) { - nbdkit_error ("failed to initialize write mutex: %m"); - goto err; - } if ((errno = pthread_mutex_init (&h->trans_lock, NULL))) { nbdkit_error ("failed to initialize transaction mutex: %m"); - pthread_mutex_destroy (&h->write_lock); goto err; } if ((errno = pthread_create (&h->reader, NULL, nbdplug_reader, h))) { nbdkit_error ("failed to initialize reader thread: %m"); - pthread_mutex_destroy (&h->write_lock); pthread_mutex_destroy (&h->trans_lock)...
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...rrno = pthread_mutex_init (&h->write_lock, NULL))) { - nbdkit_error ("failed to initialize write mutex: %m"); - goto err; - } - if ((errno = pthread_mutex_init (&h->trans_lock, NULL))) { - nbdkit_error ("failed to initialize transaction mutex: %m"); - pthread_mutex_destroy (&h->write_lock); - goto err; - } - if ((errno = pthread_create (&h->reader, NULL, nbd_reader, h))) { - nbdkit_error ("failed to initialize reader thread: %m"); - pthread_mutex_destroy (&h->write_lock); - pthread_mutex_destroy (&h->trans_lock); -...
2015 Nov 26
0
[libdrm 07/13] nouveau: stack legacy nouveau_device on top of nouveau_drm
...del(struct nouveau_device **pdev) { struct nouveau_device_priv *nvdev = nouveau_device(*pdev); if (nvdev) { - if (nvdev->close) - drmClose(nvdev->base.fd); + struct nouveau_drm *drm = nouveau_drm(&nvdev->base.object); free(nvdev->client); + nouveau_drm_del(&drm); pthread_mutex_destroy(&nvdev->lock); + if (nvdev->close) + drmClose(nvdev->base.fd); free(nvdev); *pdev = NULL; } -- 2.6.3