<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Thread Safety Analysis [-Wthread-safety-analysis] work wrong with shared lock"
href="https://bugs.llvm.org/show_bug.cgi?id=33504">33504</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Thread Safety Analysis [-Wthread-safety-analysis] work wrong with shared lock
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>4.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>kremenek@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>antinettigu@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=18656" name="attach_18656" title="Example code">attachment 18656</a> <a href="attachment.cgi?id=18656&action=edit" title="Example code">[details]</a></span>
Example code
When I use -Wthread-safety-analysis flag for code with wrapper for
std::shared_lock I have warning:
main.cpp:110:1: warning: releasing mutex 'lg_shared' using shared access,
expected exclusive access [-Wthread-safety-analysis]
So RELEASE_SHARED() attribute not works with ACQUIRE_SHARED() for scoped
capability. Example code in attachment.
build command:
clang++-4.0 -o main main.cpp -std=c++14 -lboost_system -lboost_thread -pthread
-Wthread-safety
clang++-4.0 -v
clang version 4.0.1-svn305187-1~exp1 (branches/release_40)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>