Go to file
Greg Clayton d9896733c7 <rdar://problem/11486302>
Fixed a case where multiple threads can be asking to send a packet to the GDB server and one of three things will happen:
1 - everything works
2 - one thread will fail to send the packet due to not being able to get the sequence mutex
3 - one thread will try and interrupt the other packet sending and fail and not send the packet

Now the flow is a bit different. Prior to this fix we did:

if (try_get_sequence_mutex()) {
    send_packet()
    return success;
} else {
   if (async_ok) {
       interrupt()
       send_packet() 
       resume()
       return success;
   }
}
return fail

The issue is that the call to "try_get_sequence_mutex()" could fail if another thread was sending a packet and could cause us to just not send the packet and an error would be returned.

What we really want is to try and get the sequence mutex, and if this succeeds, send the packet. Else check if we are running and if we are, do what we used to do. The big difference is when we aren't running, we wait for the sequence mutex so we don't drop packets. Pseudo code is:

if (try_get_sequence_mutex()) {
    // Safe to send the packet right away
    send_packet()
    return success;
} else {
    if (running) {
       // We are running, interrupt and send async packet if ok to do so,
       // else it is ok to fail
       if (async_ok) {
           interrupt()
           send_packet() 
           resume()
           return success;
        }
    }
    else {
        // Not running, wait for the sequence mutex so we don't drop packets
        get_sequence_mutex()
        send_packet()
        return success;
    }
}
return fail

llvm-svn: 157751
2012-05-31 16:54:51 +00:00
clang Allow some BugReports to opt-out of PathDiagnostic callstack pruning until we have significantly 2012-05-31 06:03:17 +00:00
compiler-rt [asan] partial fix for windows build 2012-05-31 16:06:05 +00:00
debuginfo-tests Revert previous patch as the corresponding clang patch was reverted. 2012-01-26 07:01:33 +00:00
libclc Add pow builtin. 2012-05-29 17:42:56 +00:00
libcxx The rules for emplace in map, multimap, unordered_map and unordered_multimap changed a while back and I'm just now updating to these new rules. In a nutshell, you've got to know you're emplacing to a pair and use one of pair's constructors. I made one extension: If you want to emplace the key and default construct the mapped_type, you can just emplace(key), as opposed to emplace(piecewise_construct, forward_as_tuple(key), forward_as_tuple()). 2012-05-25 22:04:21 +00:00
libcxxabi Fix bug in cxa_demangle involving template substitution. 2012-05-02 15:38:11 +00:00
lld Remove some compilation warnings. 2012-05-22 14:45:44 +00:00
lldb <rdar://problem/11486302> 2012-05-31 16:54:51 +00:00
llvm Fix typos noticed by Benjamin Kramer. 2012-05-31 16:04:26 +00:00
polly www: Add GPGPU Code Generation Documentation. 2012-05-30 13:54:02 +00:00