瀏覽代碼

Add start_timer_nodelay()

tags/v0.9.3
Michael Brown 17 年之前
父節點
當前提交
0a3c2b80ea
共有 2 個文件被更改,包括 13 次插入0 次删除
  1. 1
    0
      src/include/gpxe/retry.h
  2. 12
    0
      src/net/retry.c

+ 1
- 0
src/include/gpxe/retry.h 查看文件

@@ -35,6 +35,7 @@ struct retry_timer {
35 35
 };
36 36
 
37 37
 extern void start_timer ( struct retry_timer *timer );
38
+extern void start_timer_nodelay ( struct retry_timer *timer );
38 39
 extern void stop_timer ( struct retry_timer *timer );
39 40
 
40 41
 /**

+ 12
- 0
src/net/retry.c 查看文件

@@ -73,6 +73,18 @@ void start_timer ( struct retry_timer *timer ) {
73 73
 	       timer, timer->start, ( timer->start + timer->timeout ) );
74 74
 }
75 75
 
76
+/**
77
+ * Start timer with no delay
78
+ *
79
+ * @v timer		Retry timer
80
+ *
81
+ * This starts the timer running with a zero timeout value.
82
+ */
83
+void start_timer_nodelay ( struct retry_timer *timer ) {
84
+	start_timer ( timer );
85
+	timer->timeout = 0;
86
+}
87
+
76 88
 /**
77 89
  * Stop timer
78 90
  *

Loading…
取消
儲存