@@ -52,6 +52,23 @@ module stdlib_system
52
52
! > Store time at the last update
53
53
integer (TICKS) :: last_update = 0
54
54
55
+ contains
56
+
57
+ ! ! Check if process is still running
58
+ procedure :: is_running = > process_is_running
59
+
60
+ ! ! Check if process is completed
61
+ procedure :: is_completed = > process_is_completed
62
+
63
+ ! ! Return elapsed time since inception
64
+ procedure :: elapsed = > process_lifetime
65
+
66
+ ! ! Update process state internals
67
+ procedure :: update = > update_process_state
68
+
69
+ ! ! Kill a process
70
+ procedure :: kill = > process_kill
71
+
55
72
end type process_type
56
73
57
74
interface runasync
@@ -142,6 +159,7 @@ module function run_sync_args(args, stdin, want_stdout, want_stderr) result(proc
142
159
! > The output process handler.
143
160
type (process_type) :: process
144
161
end function run_sync_args
162
+
145
163
end interface run
146
164
147
165
interface is_running
@@ -264,7 +282,7 @@ end subroutine wait_for_completion
264
282
! !
265
283
module subroutine update_process_state (process )
266
284
! > The process object whose state needs to be updated.
267
- type (process_type), intent (inout ) :: process
285
+ class (process_type), intent (inout ) :: process
268
286
end subroutine update_process_state
269
287
end interface update
270
288
@@ -290,7 +308,7 @@ end subroutine update_process_state
290
308
! !
291
309
module subroutine process_kill (process , success )
292
310
! > The process object to be terminated.
293
- type (process_type), intent (inout ) :: process
311
+ class (process_type), intent (inout ) :: process
294
312
! > Boolean flag indicating whether the termination was successful.
295
313
logical , intent (out ) :: success
296
314
end subroutine process_kill
0 commit comments