Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178357947
D61277.1796570825.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
852 B
Referenced Files
None
Subscribers
None
D61277.1796570825.diff
View Options
diff --git a/usr.sbin/camdd/camdd.c b/usr.sbin/camdd/camdd.c
--- a/usr.sbin/camdd/camdd.c
+++ b/usr.sbin/camdd/camdd.c
@@ -1684,8 +1684,6 @@
pthread_mutex_lock(&dev->mutex);
- dev->flags |= CAMDD_DEV_FLAG_ACTIVE;
-
for (;;) {
struct kevent ke;
int retval = 0;
@@ -3343,13 +3341,18 @@
goto bailout;
}
+ /*
+ * Mark both devices active before starting either worker so that the
+ * reader can queue buffers before the writer starts running.
+ */
+ for (i = 0; i < num_io_opts; i++)
+ devs[i]->flags |= CAMDD_DEV_FLAG_ACTIVE;
+
for (i = 0; i < num_io_opts; i++) {
error = pthread_create(&threads[i], NULL, camdd_worker,
(void *)devs[i]);
- if (error != 0) {
- warnc(error, "pthread_create() failed");
- goto bailout;
- }
+ if (error != 0)
+ errc(1, error, "pthread_create() failed");
}
for (;;) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 6, 3:27 PM (13 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41556324
Default Alt Text
D61277.1796570825.diff (852 B)
Attached To
Mode
D61277: camdd: Fix the worker startup race
Attached
Detach File
Event Timeline