File tree Expand file tree Collapse file tree 5 files changed +21
-18
lines changed Expand file tree Collapse file tree 5 files changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: c96b1d89c490807b7ecdc9929a445dd82987275c
9
+ refs/heads/dist-snap: 4c75d36d0e81508d4e7614104abb44fa19179c03
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -787,7 +787,7 @@ mod bench {
787
787
pub fn parse_str ( bh : & mut BenchHarness ) {
788
788
let s = "urn:uuid:F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4" ;
789
789
do bh. iter {
790
- Uuid :: parse_string ( s) ;
790
+ let u = Uuid :: parse_string ( s) ;
791
791
}
792
792
}
793
793
}
Original file line number Diff line number Diff line change @@ -563,11 +563,10 @@ impl Scheduler {
563
563
// run the cleanup job, as expected by the previously called
564
564
// swap_contexts function.
565
565
unsafe {
566
- let sched = Local :: unsafe_borrow :: < Scheduler > ( ) ;
567
- ( * sched) . run_cleanup_job ( ) ;
566
+ let task = Local :: unsafe_borrow :: < Task > ( ) ;
567
+ ( * task ) . sched . get_mut_ref ( ) . run_cleanup_job ( ) ;
568
568
569
569
// Must happen after running the cleanup job (of course).
570
- let task = Local :: unsafe_borrow :: < Task > ( ) ;
571
570
( * task) . death . check_killed ( ( * task) . unwinder . unwinding ) ;
572
571
}
573
572
}
Original file line number Diff line number Diff line change @@ -949,7 +949,7 @@ fn waitpid(pid: pid_t) -> int {
949
949
#[ cfg( test) ]
950
950
mod tests {
951
951
use io;
952
- use libc:: c_int;
952
+ use libc:: { c_int, uintptr_t } ;
953
953
use option:: { Option , None , Some } ;
954
954
use os;
955
955
use path:: Path ;
Original file line number Diff line number Diff line change @@ -281,20 +281,24 @@ impl<T> Drop for UnsafeAtomicRcBox<T>{
281
281
*/
282
282
// FIXME(#8140) should not be pub
283
283
pub unsafe fn atomically < U > ( f : & fn ( ) -> U ) -> U {
284
- use rt:: task:: Task ;
284
+ use rt:: task:: { Task , GreenTask , SchedTask } ;
285
285
use rt:: local:: Local ;
286
- use rt:: in_green_task_context;
287
-
288
- if in_green_task_context ( ) {
289
- let t = Local :: unsafe_borrow :: < Task > ( ) ;
290
- do ( || {
291
- ( * t) . death . inhibit_deschedule ( ) ;
292
- f ( )
293
- } ) . finally {
294
- ( * t) . death . allow_deschedule ( ) ;
286
+
287
+ match Local :: try_unsafe_borrow :: < Task > ( ) {
288
+ Some ( t) => {
289
+ match ( * t) . task_type {
290
+ GreenTask ( _) => {
291
+ do ( || {
292
+ ( * t) . death . inhibit_deschedule ( ) ;
293
+ f ( )
294
+ } ) . finally {
295
+ ( * t) . death . allow_deschedule ( ) ;
296
+ }
297
+ }
298
+ SchedTask => f ( )
299
+ }
295
300
}
296
- } else {
297
- f ( )
301
+ None => f ( )
298
302
}
299
303
}
300
304
You can’t perform that action at this time.
0 commit comments