Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
c-utility/pal/generic/refcount_os.h@0:f7f1f0d76dd6, 2018-08-23 (annotated)
- Committer:
- XinZhangMS
- Date:
- Thu Aug 23 06:52:14 2018 +0000
- Revision:
- 0:f7f1f0d76dd6
azure-c-sdk for mbed os supporting NUCLEO_F767ZI
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| XinZhangMS | 0:f7f1f0d76dd6 | 1 | // Copyright (c) Microsoft. All rights reserved. |
| XinZhangMS | 0:f7f1f0d76dd6 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| XinZhangMS | 0:f7f1f0d76dd6 | 3 | |
| XinZhangMS | 0:f7f1f0d76dd6 | 4 | // This file gets included into refcount.h as a means of extending the behavior of |
| XinZhangMS | 0:f7f1f0d76dd6 | 5 | // atomic increment, decrement, and test. |
| XinZhangMS | 0:f7f1f0d76dd6 | 6 | // |
| XinZhangMS | 0:f7f1f0d76dd6 | 7 | // The Azure IoT C SDK does not require thread-safe refcount operations, so |
| XinZhangMS | 0:f7f1f0d76dd6 | 8 | // this file is appropriate for any device when using the Azure IoT C SDK. |
| XinZhangMS | 0:f7f1f0d76dd6 | 9 | |
| XinZhangMS | 0:f7f1f0d76dd6 | 10 | #ifndef REFCOUNT_OS_H__GENERIC |
| XinZhangMS | 0:f7f1f0d76dd6 | 11 | #define REFCOUNT_OS_H__GENERIC |
| XinZhangMS | 0:f7f1f0d76dd6 | 12 | |
| XinZhangMS | 0:f7f1f0d76dd6 | 13 | #define COUNT_TYPE uint32_t |
| XinZhangMS | 0:f7f1f0d76dd6 | 14 | |
| XinZhangMS | 0:f7f1f0d76dd6 | 15 | #define DEC_RETURN_ZERO (0) |
| XinZhangMS | 0:f7f1f0d76dd6 | 16 | #define INC_REF(type, var) ++((((REFCOUNT_TYPE(type)*)var)->count)) |
| XinZhangMS | 0:f7f1f0d76dd6 | 17 | #define DEC_REF(type, var) --((((REFCOUNT_TYPE(type)*)var)->count)) |
| XinZhangMS | 0:f7f1f0d76dd6 | 18 | #define INIT_REF(type, var) do { ((REFCOUNT_TYPE(type)*)var)->count = 1; } while((void)0,0) |
| XinZhangMS | 0:f7f1f0d76dd6 | 19 | |
| XinZhangMS | 0:f7f1f0d76dd6 | 20 | #endif // REFCOUNT_OS_H__GENERIC |