Initial attempt at deadlock detection
Initial attempt at deadlock detection

Whenever the -b switch is used at run time, the pthread version of the runtime
will try to detect when the program is deadlocked.  Currently, this only works
in a single locale, and it only detects deadlocks due to unavailable sync
variables.  Basically, a count of threads potentially waiting on some sync or
single variable is kept.  Idle threads are included in this count.  If the count
reaches the number of existing threads, then instead of blocking unconditionally
on the sync variable, it only blocks for a small period of time (currently one
second).  If no activity is detected during this time, deadlock is signaled, and
the program is terminated after printing where each thread was blocked.

This is not yet very well tested, but hopefully users can try it and comment on
it.  Also, there is no test yet for this feature; a test will be forthcoming.


git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@14166 3a8e244f-b0f2-452b-bcba-4c88e055c3ca

sungeunchoi/chapel,hildeth/chapel,sungeunchoi/chapel,chizarlicious/chapel,sungeunchoi/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,hildeth/chapel,sungeunchoi/chapel,sungeunchoi/chapel,hildeth/chapel,CoryMcCartan/chapel,chizarlicious/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,hildeth/chapel,chizarlicious/chapel,chizarlicious/chapel,CoryMcCartan/chapel,sungeunchoi/chapel