Skip to content

Instantly share code, notes, and snippets.

View benloong's full-sized avatar

benloong benloong

View GitHub Profile
@benloong
benloong / workstealingqueue.cpp
Created March 23, 2019 08:32
work stealing queue
#include <atomic>
class Job;
struct WorkStealingQueue
{
// only called by owner work thread
void Push(Job* job) noexcept
{
// m_bottom -> stealing thread read, owner thread read, write.
@benloong
benloong / NesteScrollRect.cs
Created December 28, 2022 08:00 — forked from Josef212/NesteScrollRect.cs
A nested ScrollRect for unity
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class NestedScrollRect : ScrollRect
{
public override void OnInitializePotentialDrag(PointerEventData eventData)
{
for(int i = 0; i < m_parentInitializePotentialDragHandlers.Length; ++i)
{