rust/src
Alex Crichton b70ec4d9f0 rollup merge of #21678: vojtechkral/threads-native-names
Fixes #10302

I really am not sure I'm doing this right, so here goes nothing...

Also testing this isn't easy. I don't have any other *nix boxes besides a Linux one.

Test code:

```rust
use std::thread;
use std::io::timer::sleep;
use std::time::duration::Duration;

fn make_thread<'a>(i: i64) -> thread::JoinGuard<'a, ()>
{
	thread::Builder::new().name(format!("MyThread{}", i).to_string()).scoped(move ||
	{
		println!("Start: {}", i);
		sleep(Duration::seconds(i));
		println!("End: {}", i);
	})
}

fn main()
{
	let mut guards = vec![make_thread(3)];

	for i in 4i64..16
	{
		guards.push(make_thread(i));
	}
}
```

GDB output on my machine:

```
(gdb) info threads
  Id   Target Id         Frame
  15   Thread 0x7fdfbb35f700 (LWP 23575) "MyThread3" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  14   Thread 0x7fdfba7ff700 (LWP 23576) "MyThread4" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  13   Thread 0x7fdfba5fe700 (LWP 23577) "MyThread5" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  12   Thread 0x7fdfba3fd700 (LWP 23578) "MyThread6" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  11   Thread 0x7fdfb8dfe700 (LWP 23580) "MyThread4" 0x00007fdfbb746193 in select () from /usr/lib/libc.so.6
  10   Thread 0x7fdfb8fff700 (LWP 23579) "MyThread7" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  9    Thread 0x7fdfb8bfd700 (LWP 23581) "MyThread8" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  8    Thread 0x7fdfb3fff700 (LWP 23582) "MyThread9" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  7    Thread 0x7fdfb3dfe700 (LWP 23583) "MyThread10" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  6    Thread 0x7fdfb3bfd700 (LWP 23584) "MyThread11" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  5    Thread 0x7fdfb2bff700 (LWP 23585) "MyThread12" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  4    Thread 0x7fdfb29fe700 (LWP 23586) "MyThread13" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  3    Thread 0x7fdfb27fd700 (LWP 23587) "MyThread14" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
  2    Thread 0x7fdfb1bff700 (LWP 23588) "MyThread15" 0x00007fdfbbe35a8d in nanosleep () from /usr/lib/libpthread.so.0
* 1    Thread 0x7fdfbc411800 (LWP 23574) "threads" 0x00007fdfbbe2e505 in pthread_join () from /usr/lib/libpthread.so.0
```
(I'm not sure why one of the threads is duplicated, but it does that without my patch too...)
2015-01-30 12:02:53 -08:00
..
compiler-rt@58ab642c30 Updated compiler-rt 2015-01-09 18:38:30 +02:00
compiletest s/Show/Debug/g 2015-01-29 07:49:02 -05:00
doc fix fallout 2015-01-30 10:37:44 -05:00
driver Set unstable feature names appropriately 2015-01-23 13:28:40 -08:00
etc Rollup merge of 21643 - semarie:break-local_stage0, r=brson 2015-01-29 03:17:16 +05:30
grammar cleanup: s/v.slice*()/&v[a..b]/g + remove redundant as_slice() calls 2015-01-27 09:03:06 -05:00
jemalloc@b001609960
liballoc Auto merge of #21677 - japaric:no-range, r=alexcrichton 2015-01-29 16:28:52 +00:00
libarena for x in range(a, b) -> for x in a..b 2015-01-29 07:47:37 -05:00
libbacktrace
libcollections s/while let/for/g now that #21245 has been fixed 2015-01-30 10:37:45 -05:00
libcore fixes after rebase 2015-01-30 10:37:45 -05:00
libcoretest remove Copy impls from iterators 2015-01-30 10:37:44 -05:00
libflate for x in range(a, b) -> for x in a..b 2015-01-29 07:47:37 -05:00
libfmt_macros Rollup merge of 21681 - japaric:no-warn, r=alexcrichton 2015-01-29 03:14:35 +05:30
libgetopts s/Show/Debug/g 2015-01-29 07:49:02 -05:00
libgraphviz s/Show/Debug/g 2015-01-29 07:49:02 -05:00
liblibc Rollup merge of #21640 - retep998:rmdir, r=alexcrichton 2015-01-29 03:04:10 +05:30
liblog s/Show/Debug/g 2015-01-29 07:49:02 -05:00
librand fix fallout 2015-01-30 10:37:44 -05:00
librbml s/Show/Debug/g 2015-01-29 07:49:02 -05:00
librustc rollup merge of #21495: richo/unexported-unmangled-lint 2015-01-30 12:02:51 -08:00
librustc_back remove dead code 2015-01-30 10:37:44 -05:00
librustc_bitflags s/Show/Debug/g 2015-01-29 07:49:02 -05:00
librustc_borrowck Auto merge of #21691 - edwardw:double-closure, r=nikomatsakis 2015-01-29 19:36:03 +00:00
librustc_driver s/Show/Debug/g 2015-01-29 07:49:02 -05:00
librustc_llvm s/Show/Debug/g 2015-01-29 07:49:02 -05:00
librustc_privacy Merge remote-tracking branch 'rust-lang/master' 2015-01-26 15:42:32 -08:00
librustc_resolve remove dead code 2015-01-30 10:37:44 -05:00
librustc_trans rollup merge of #21385: nick29581/save-fix2 2015-01-30 12:02:46 -08:00
librustc_typeck fixes after rebase 2015-01-30 10:37:45 -05:00
librustdoc fixes after rebase 2015-01-30 10:37:45 -05:00
libserialize s/while let/for/g now that #21245 has been fixed 2015-01-30 10:37:45 -05:00
libstd rollup merge of #21678: vojtechkral/threads-native-names 2015-01-30 12:02:53 -08:00
libsyntax fixes after rebase 2015-01-30 10:37:45 -05:00
libterm s/Show/Debug/g 2015-01-29 07:49:02 -05:00
libtest fixes after rebase 2015-01-30 10:37:45 -05:00
libunicode remove Copy impls from iterators 2015-01-30 10:37:44 -05:00
llvm@b820135911 Redo Segmented stack support for DragonFly 2015-01-18 08:25:52 +01:00
rt rt: Remove libtime wrappers 2015-01-19 23:05:10 +09:00
rust-installer@e577c97b49 Fix revert of rust-installer 2015-01-09 10:19:30 -08:00
rustbook rollup merge of #21494: jatinn/jsnav 2015-01-30 12:02:48 -08:00
rustllvm Better inline assembly errors 2015-01-22 19:43:39 +01:00
test rollup merge of #21495: richo/unexported-unmangled-lint 2015-01-30 12:02:51 -08:00
snapshots.txt register snaphots 2015-01-29 07:49:02 -05:00