Skip to content

Std read-write lock support and adaptation std fs #203

@weiwenhao

Description

@weiwenhao

fn main() {
    var f = fs.open('./test.txt', syscall.O_RDONLY, 0)

    for int i = 0; i < 10; i += 1 {
        go fn():void! {
            var c = client.multipart_t_new()
            var parts = c.text('username', 'nature user')
                 .text('message', 'hello from nature!')
                 .file('testfile', 'test.txt', f.content())
        }()
    }

    co.sleep(1000)
}

Operations like this can cause unpredictable crashes because only one coroutine can exist in fd at a time, and using fd concurrently can lead to abnormal crashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions