File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 4
4
* runs a loop that receives, dispatches and replies kernel requests.
5
5
*/
6
6
7
+ use std:: cell:: Cell ;
7
8
use std:: task;
8
9
use std:: libc:: { EAGAIN , EINTR , ENODEV , ENOENT } ;
9
10
use channel:: Channel ;
@@ -78,12 +79,11 @@ impl BackgroundSession {
78
79
/// Start the session loop of the given session in a background task
79
80
pub fn start < FS : Filesystem +Send > ( se : Session < FS > ) -> BackgroundSession {
80
81
let mountpoint = se. mountpoint . clone ( ) ;
81
- let mut t = task :: task ( ) ;
82
+ let se = Cell :: new ( se ) ;
82
83
// The background task is started using a a new single threaded
83
84
// scheduler since I/O in the session loop can block
84
- t. sched_mode ( task:: SingleThreaded ) ;
85
- do t. spawn_with ( se) |mut se| {
86
- se. run ( ) ;
85
+ do task:: spawn_sched ( task:: SingleThreaded ) {
86
+ se. take ( ) . run ( ) ;
87
87
}
88
88
BackgroundSession { mountpoint : mountpoint }
89
89
}
You can’t perform that action at this time.
0 commit comments