~mil/mepo

0ffcf7bd14a5877124f7079748f55607c676ba97 — Miles Alan 1 year, 11 months ago 96d5631 test-rand-ids-for-sdl-threadname
Creating random names for sdl thread ids created
1 files changed, 4 insertions(+), 1 deletions(-)

M src/api/shellpipe.zig
M src/api/shellpipe.zig => src/api/shellpipe.zig +4 -1
@@ 35,7 35,10 @@ fn shellpipe(mepo: *Mepo, as_async: bool, cmd: []const u8) !void {
        var sp_req = try mepo.allocator.create(ShellpipeRequest);
        sp_req.cmd = try mepo.allocator.dupeZ(u8, cmd);
        sp_req.mepo = mepo;
        if (sdl.SDL_CreateThread(async_shellpipe_run, "async_shellpipe", sp_req)) |sdl_thread| {
        var id: [10:0]u8 = undefined;
        std.rand.DefaultPrng.init(0).random().bytes(id[0..]);
        const id_z = try mepo.allocator.dupeZ(u8, id[0..]);
        if (sdl.SDL_CreateThread(async_shellpipe_run, id_z, sp_req)) |sdl_thread| {
            const thread_id = sdl.SDL_GetThreadID(sdl_thread);
            try mepo.async_shellpipe_threads.put(thread_id, void{});
        }