Mercurial > lcfOS
view kernel/process.c3 @ 288:a747a45dcd78
Various styling work
author | Windel Bouwman |
---|---|
date | Thu, 21 Nov 2013 14:26:13 +0100 |
parents | c9781c73e7e2 |
children | 534b94b40aa8 |
line wrap: on
line source
module process; import memory; import kernel; // process type definition: typedef struct { int id; } process_t; // init is the root of all processes: var process_t* init = 0; var int next_pid = 0; public func void Init() { next_pid = 0; init = Create(); } /* Create a new process. */ public func process_t* Create() { process_t* p = memory.Alloc(sizeof(process_t)); p->id = next_pid; next_pid++; return p; } public func void Kill(process_t* p) { // clean memory }