Skip to content
  • This project
    • Loading...
  • Sign in

杨涛 / test

Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • test
  • rt-thread
  • components
  • libc
  • cplusplus
  • cxx_lock.h
  • 杨涛's avatar
    test · d013bcb5
    d013bcb5
    杨涛 committed 2022-12-07 16:05:26 +0800
cxx_lock.h 412 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2016/10/1      Bernard      The first version
 */

#pragma once

#include <stdint.h>
#include <string.h>

namespace rtthread {

class Lock
{
public:
    Lock(Mutex& mutex) : m(mutex) {m.lock();}
    ~Lock() {m.unlock();}

protected:
    Mutex &m;
};

}