File tree Expand file tree Collapse file tree 3 files changed +14
-16
lines changed Expand file tree Collapse file tree 3 files changed +14
-16
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 697f1e38d646bb6c7bab054c8c8c5b469c566ef6
2
+ refs/heads/master: 404afcbb41898cf7f516f07cae3dc42e47bda46d
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Original file line number Diff line number Diff line change @@ -104,19 +104,17 @@ impl methods<T: send> for exclusive<T> {
104
104
arc_destruct ( self . data )
105
105
}
106
106
107
- fn with < U > ( f : fn ( sys:: condition , x : & T ) -> U ) -> U {
108
- unsafe {
109
- let ptr: ~arc_data < ex_data < T > > =
110
- unsafe :: reinterpret_cast ( self . data ) ;
111
- let r = {
112
- let rec: & ex_data < T > = & ( * ptr) . data ;
113
- rec. lock . lock_cond ( ) { |c|
114
- f ( c, & rec. data )
115
- }
116
- } ;
117
- unsafe :: forget ( ptr) ;
118
- r
119
- }
107
+ unsafe fn with < U > ( f : fn ( sys:: condition , x : & T ) -> U ) -> U {
108
+ let ptr: ~arc_data < ex_data < T > > =
109
+ unsafe :: reinterpret_cast ( self . data ) ;
110
+ let r = {
111
+ let rec: & ex_data < T > = & ( * ptr) . data ;
112
+ rec. lock . lock_cond ( ) { |c|
113
+ f ( c, & rec. data )
114
+ }
115
+ } ;
116
+ unsafe :: forget ( ptr) ;
117
+ r
120
118
}
121
119
}
122
120
Original file line number Diff line number Diff line change @@ -106,13 +106,13 @@ fn create_lock() -> lock_and_signal {
106
106
}
107
107
108
108
impl methods for lock_and_signal {
109
- fn lock < T > ( f : fn ( ) -> T ) -> T {
109
+ unsafe fn lock < T > ( f : fn ( ) -> T ) -> T {
110
110
rustrt:: rust_lock_cond_lock ( self . lock ) ;
111
111
let _r = unlock ( self . lock ) ;
112
112
f ( )
113
113
}
114
114
115
- fn lock_cond < T > ( f : fn ( condition ) -> T ) -> T {
115
+ unsafe fn lock_cond < T > ( f : fn ( condition ) -> T ) -> T {
116
116
rustrt:: rust_lock_cond_lock ( self . lock ) ;
117
117
let _r = unlock ( self . lock ) ;
118
118
f ( condition_ ( self . lock ) )
You can’t perform that action at this time.
0 commit comments