Skip to content

Instantly share code, notes, and snippets.

@bblum
Created June 28, 2012 19:50
Show Gist options
  • Select an option

  • Save bblum/3013458 to your computer and use it in GitHub Desktop.

Select an option

Save bblum/3013458 to your computer and use it in GitHub Desktop.
1287 #[test]
1288 #[should_fail]
1289 #[ignore(cfg(windows))]
1290 fn test_tls_cleanup_on_failure() unsafe {
1291 fn str_key(+_x: @str) { }
1292 fn box_key(+_x: @@()) { }
1293 fn int_key(+_x: @int) { }
1294 local_data_set(str_key, @"parent data");
1295 local_data_set(box_key, @@());
1296 task::spawn{|| // spawn_linked
1297 local_data_set(str_key, @"string data");
1298 local_data_set(box_key, @@());
1299 local_data_set(int_key, @42);
1300 fail;
1301 }
1302 // Not quite nondeterministic.
1303 local_data_set(int_key, @31337);
1304 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment