My Project: dynamics.mod/NewtonDynamics/source/pthreads.2/ptw32_OLL_lock.c File Reference

My Project

Classes | Macros | Typedefs | Enumerations | Functions | Variables
ptw32_OLL_lock.c File Reference
`#include "pthread.h"`
`#include "sched.h"`
`#include "implement.h"`
`#include <stdio.h>`

## Classes

union | ptw32_oll_counter_t_
struct | ptw32_oll_snziRoot_t_
struct | ptw32_oll_queryResult_t_
union | ptw32_oll_snziNodeOrRoot_t_
struct | ptw32_oll_snziNode_t_
struct | ptw32_oll_ticket_t_
struct | ptw32_oll_csnzi_t_
struct | ptw32_foll_node_t_
struct | ptw32_foll_local_t_
struct | ptw32_foll_rwlock_t_
struct | ptw32_srwl_rwlock_t_
struct | ptw32_srwl_node_t_
struct | ptw32_srwl_local_t_

## Macros

#define | PTW32_OLL_MAXREADERS (((size_t)2<<(ptw32_oll_countWidth-1))-1)

## Typedefs

typedef union ptw32_oll_counter_t_ | ptw32_oll_counter_t
typedef struct ptw32_oll_snziRoot_t_ | ptw32_oll_snziRoot_t
typedef struct ptw32_oll_snziNode_t_ | ptw32_oll_snziNode_t
typedef union ptw32_oll_snziNodeOrRoot_t_ | ptw32_oll_snziNodeOrRoot_t
typedef struct ptw32_oll_queryResult_t_ | ptw32_oll_queryResult_t
typedef struct ptw32_oll_ticket_t_ | ptw32_oll_ticket_t
typedef struct ptw32_oll_csnzi_t_ | ptw32_oll_csnzi_t
typedef struct ptw32_foll_node_t_ | ptw32_foll_node_t
typedef struct ptw32_foll_local_t_ | ptw32_foll_local_t
typedef struct ptw32_foll_rwlock_t_ | ptw32_foll_rwlock_t
typedef struct ptw32_srwl_rwlock_t_ | ptw32_srwl_rwlock_t
typedef struct ptw32_srwl_node_t_ | ptw32_srwl_node_t
typedef struct ptw32_srwl_local_t_ | ptw32_srwl_local_t

## Enumerations

enum | { ptw32_archWidth = sizeof(size_t)*8, ptw32_oll_countWidth = ptw32_archWidth-2 }
enum | { ptw32_oll_snziRoot_open = 0, ptw32_oll_snziRoot_closed = 1 }
enum | { ptw32_oll_snzi_root = 0, ptw32_oll_snzi_node = 1 }
enum | { ptw32_srwl_reader = 0, ptw32_srwl_writer = 1 }
enum | { ptw32_srwl_free = 0, ptw32_srwl_in_use = 1 }
enum | { ptw32_srwl_reader = 0, ptw32_srwl_writer = 1 }
enum | { ptw32_srwl_free = 0, ptw32_srwl_in_use = 1 }

## Functions

BOOL | ptw32_oll_ShouldArriveAtTree ()
size_t | ptw32_oll_GetLeafForThread ()
ptw32_oll_ticket_t | ptw32_oll_Arrive (ptw32_oll_csnzi_t *csnzi)
BOOL | ptw32_oll_Depart (ptw32_oll_ticket_t ticket)
BOOL | ptw32_oll_TreeArrive (ptw32_oll_snziNodeOrRoot_t snziNodeOrRoot)
BOOL | ptw32_oll_TreeDepart (ptw32_oll_snziNodeOrRoot_t snziNodeOrRoot)
void | ptw32_oll_Open (ptw32_oll_csnzi_t *csnziPtr)
void | ptw32_oll_OpenWithArrivals (ptw32_oll_csnzi_t *csnziPtr, size_t count, BOOL close)
BOOL | ptw32_oll_Close (ptw32_oll_csnzi_t *csnziPtr)
BOOL | ptw32_oll_CloseIfEmpty (ptw32_oll_csnzi_t *csnziPtr)
ptw32_oll_queryResult_t | ptw32_oll_Query (ptw32_oll_csnzi_t *csnziPtr)
BOOL | ptw32_oll_Arrived (ptw32_oll_ticket_t t)
ptw32_oll_ticket_t | ptw32_oll_DirectTicket (ptw32_oll_csnzi_t *csnziPtr)
ptw32_srwl_node_t * | ptw32_srwl_AllocReaderNode (ptw32_srwl_local_t *local)
void | ptw32_srwl_FreeReaderNode (ptw32_srwl_node_t *nodePtr)
void | ptw32_srwl_WriterLock (ptw32_srwl_rwlock_t *lockPtr, ptw32_srwl_local_t *localPtr)
void | ptw32_srwl_WriterUnlock (ptw32_srwl_rwlock_t *lockPtr, ptw32_srwl_local_t *localPtr)
void | ptw32_srwl_ReaderLock (ptw32_srwl_rwlock_t *lockPtr, ptw32_srwl_local_t *localPtr)
void | ptw32_srwl_ReaderUnlock (ptw32_srwl_rwlock_t *lockPtr, ptw32_srwl_local_t *localPtr)
int | main ()

## Variables

ptw32_oll_snziRoot_t | ptw32_oll_snziRoot_openAndZero
ptw32_oll_snziRoot_t | ptw32_oll_snziRoot_closedAndZero
ptw32_oll_ticket_t | ptw32_oll_ticket_null = {NULL}

## Macro Definition Documentation

## § PTW32_OLL_MAXREADERS

#define PTW32_OLL_MAXREADERS (((size_t)2<<(ptw32_oll_countWidth-1))-1)

## Typedef Documentation

## § ptw32_foll_local_t

typedef struct ptw32_foll_local_t_ ptw32_foll_local_t

## § ptw32_foll_node_t

typedef struct ptw32_foll_node_t_ ptw32_foll_node_t

## § ptw32_foll_rwlock_t

typedef struct ptw32_foll_rwlock_t_ ptw32_foll_rwlock_t

## § ptw32_oll_counter_t

typedef union ptw32_oll_counter_t_ ptw32_oll_counter_t

## § ptw32_oll_csnzi_t

typedef struct ptw32_oll_csnzi_t_ ptw32_oll_csnzi_t

## § ptw32_oll_queryResult_t

typedef struct ptw32_oll_queryResult_t_ ptw32_oll_queryResult_t

## § ptw32_oll_snziNode_t

typedef struct ptw32_oll_snziNode_t_ ptw32_oll_snziNode_t

## § ptw32_oll_snziNodeOrRoot_t

typedef union ptw32_oll_snziNodeOrRoot_t_ ptw32_oll_snziNodeOrRoot_t

## § ptw32_oll_snziRoot_t

typedef struct ptw32_oll_snziRoot_t_ ptw32_oll_snziRoot_t

## § ptw32_oll_ticket_t

typedef struct ptw32_oll_ticket_t_ ptw32_oll_ticket_t

## § ptw32_srwl_local_t

typedef struct ptw32_srwl_local_t_ ptw32_srwl_local_t

## § ptw32_srwl_node_t

typedef struct ptw32_srwl_node_t_ ptw32_srwl_node_t

## § ptw32_srwl_rwlock_t

typedef struct ptw32_srwl_rwlock_t_ ptw32_srwl_rwlock_t

## Enumeration Type Documentation

## § anonymous enum

anonymous enum

Enumerator
ptw32_archWidth |
ptw32_oll_countWidth |

## § anonymous enum

anonymous enum

Enumerator
ptw32_oll_snziRoot_open |
ptw32_oll_snziRoot_closed |

## § anonymous enum

anonymous enum

Enumerator
ptw32_oll_snzi_root |
ptw32_oll_snzi_node |

## § anonymous enum

anonymous enum

Enumerator
ptw32_srwl_reader |
ptw32_srwl_writer |

## § anonymous enum

anonymous enum

Enumerator
ptw32_srwl_free |
ptw32_srwl_in_use |

## § anonymous enum

anonymous enum

Enumerator
ptw32_srwl_reader |
ptw32_srwl_writer |

## § anonymous enum

anonymous enum

Enumerator
ptw32_srwl_free |
ptw32_srwl_in_use |

## Function Documentation

## § main()

int main | ( |  | ) |

## § ptw32_oll_Arrive()

ptw32_oll_ticket_t ptw32_oll_Arrive | ( | ptw32_oll_csnzi_t * | csnzi | ) |

## § ptw32_oll_Arrived()

BOOL ptw32_oll_Arrived | ( | ptw32_oll_ticket_t | t | ) |

## § ptw32_oll_Close()

BOOL ptw32_oll_Close | ( | ptw32_oll_csnzi_t * | csnziPtr | ) |

## § ptw32_oll_CloseIfEmpty()

BOOL ptw32_oll_CloseIfEmpty | ( | ptw32_oll_csnzi_t * | csnziPtr | ) |

## § ptw32_oll_Depart()

BOOL ptw32_oll_Depart | ( | ptw32_oll_ticket_t | ticket | ) |

## § ptw32_oll_DirectTicket()

ptw32_oll_ticket_t ptw32_oll_DirectTicket | ( | ptw32_oll_csnzi_t * | csnziPtr | ) |

## § ptw32_oll_GetLeafForThread()

size_t ptw32_oll_GetLeafForThread | ( |  | ) |

## § ptw32_oll_Open()

void ptw32_oll_Open | ( | ptw32_oll_csnzi_t * | csnziPtr | ) |

## § ptw32_oll_OpenWithArrivals()

void ptw32_oll_OpenWithArrivals | ( | ptw32_oll_csnzi_t * | csnziPtr,
|  | size_t | count,
|  | BOOL | close
| ) |  |

## § ptw32_oll_Query()

ptw32_oll_queryResult_t ptw32_oll_Query | ( | ptw32_oll_csnzi_t * | csnziPtr | ) |

## § ptw32_oll_ShouldArriveAtTree()

BOOL ptw32_oll_ShouldArriveAtTree | ( |  | ) |

## § ptw32_oll_TreeArrive()

BOOL ptw32_oll_TreeArrive | ( | ptw32_oll_snziNodeOrRoot_t | snziNodeOrRoot | ) |

## § ptw32_oll_TreeDepart()

BOOL ptw32_oll_TreeDepart | ( | ptw32_oll_snziNodeOrRoot_t | snziNodeOrRoot | ) |

## § ptw32_srwl_AllocReaderNode()

ptw32_srwl_node_t* ptw32_srwl_AllocReaderNode | ( | ptw32_srwl_local_t * | local | ) |

## § ptw32_srwl_FreeReaderNode()

void ptw32_srwl_FreeReaderNode | ( | ptw32_srwl_node_t * | nodePtr | ) |

## § ptw32_srwl_ReaderLock()

void ptw32_srwl_ReaderLock | ( | ptw32_srwl_rwlock_t * | lockPtr,
|  | ptw32_srwl_local_t * | localPtr
| ) |  |

## § ptw32_srwl_ReaderUnlock()

void ptw32_srwl_ReaderUnlock | ( | ptw32_srwl_rwlock_t * | lockPtr,
|  | ptw32_srwl_local_t * | localPtr
| ) |  |

## § ptw32_srwl_WriterLock()

void ptw32_srwl_WriterLock | ( | ptw32_srwl_rwlock_t * | lockPtr,
|  | ptw32_srwl_local_t * | localPtr
| ) |  |

## § ptw32_srwl_WriterUnlock()

void ptw32_srwl_WriterUnlock | ( | ptw32_srwl_rwlock_t * | lockPtr,
|  | ptw32_srwl_local_t * | localPtr
| ) |  |

## Variable Documentation

## § ptw32_oll_snziRoot_closedAndZero

ptw32_oll_snziRoot_t ptw32_oll_snziRoot_closedAndZero

Initial value:
= {.counter.internal.count = 0,
.counter.internal.root = ptw32_oll_snzi_root,
.counter.internal.state = ptw32_oll_snziRoot_closed}
ptw32_oll_snziRoot_closed
Definition: ptw32_OLL_lock.c:102
ptw32_oll_snzi_root
Definition: ptw32_OLL_lock.c:107

## § ptw32_oll_snziRoot_openAndZero

ptw32_oll_snziRoot_t ptw32_oll_snziRoot_openAndZero

Initial value:
= {.counter.internal.count = 0,
.counter.internal.root = ptw32_oll_snzi_root,
.counter.internal.state = ptw32_oll_snziRoot_open}
ptw32_oll_snzi_root
Definition: ptw32_OLL_lock.c:107
ptw32_oll_snziRoot_open
Definition: ptw32_OLL_lock.c:101

## § ptw32_oll_ticket_null

ptw32_oll_ticket_t ptw32_oll_ticket_null = {NULL}