[llvm-commits] [compiler-rt] r169973 - /compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h

Dmitry Vyukov dvyukov at google.com
Wed Dec 12 04:45:07 PST 2012


Author: dvyukov
Date: Wed Dec 12 06:45:07 2012
New Revision: 169973

URL: http://llvm.org/viewvc/llvm-project?rev=169973&view=rev
Log:
tsan: add comment to tsan_fd.h file

Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h?rev=169973&r1=169972&r2=169973&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h Wed Dec 12 06:45:07 2012
@@ -9,6 +9,27 @@
 //
 // This file is a part of ThreadSanitizer (TSan), a race detector.
 //
+// This file handles synchronization via IO.
+// People use IO for synchronization along the lines of:
+//
+// int X;
+// int client_socket;  // initialized elsewhere
+// int server_socket;  // initialized elsewhere
+//
+// Thread 1:
+// X = 42;
+// send(client_socket, ...);
+//
+// Thread 2:
+// if (recv(server_socket, ...) > 0)
+//   assert(X == 42);
+//
+// This file determines the scope of the file descriptor (pipe, socket,
+// all local files, etc) and executes acquire and release operations on
+// the scope as necessary.  Some scopes are very fine grained (e.g. pipe
+// operations synchronize only with operations on the same pipe), while
+// others are corse-grained (e.g. all operations on local files synchronize
+// with each other).
 //===----------------------------------------------------------------------===//
 #ifndef TSAN_FD_H
 #define TSAN_FD_H





More information about the llvm-commits mailing list